CN107967328A - Solving Hessian causes the incompatible methods of hibernate - Google Patents

Solving Hessian causes the incompatible methods of hibernate Download PDF

Info

Publication number
CN107967328A
CN107967328A CN201711194169.5A CN201711194169A CN107967328A CN 107967328 A CN107967328 A CN 107967328A CN 201711194169 A CN201711194169 A CN 201711194169A CN 107967328 A CN107967328 A CN 107967328A
Authority
CN
China
Prior art keywords
hessian
hibernate
content
causes
endless loop
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201711194169.5A
Other languages
Chinese (zh)
Other versions
CN107967328B (en
Inventor
李波
岳永胜
孙小波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Changhong Electric Co Ltd filed Critical Sichuan Changhong Electric Co Ltd
Priority to CN201711194169.5A priority Critical patent/CN107967328B/en
Publication of CN107967328A publication Critical patent/CN107967328A/en
Application granted granted Critical
Publication of CN107967328B publication Critical patent/CN107967328B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries

Abstract

The invention discloses a kind of solution Hessian to cause the incompatible methods of hibernate, including:One object is passed to and is filtered;Judge whether the object in the step 1 is conventional object, in the case where the object is conventional object, then without traversal;Judge whether the object belongs to collection object again, if collection object, then its aggregates content is traveled through out, then recurrence again;, it is necessary to determine whether endless loop when recurrence;Specifically inside filtering class, judging whether it is Entity.class, if it does, just needing to replace the set element of the inside;The content of set the inside is replaced, after content is replaced, hessian would not report an error.When the present invention solves Hessian serializings, session caused more than 7 to@OneToMany correspondences in hibernate closes the problem of abnormal, and is easy to practical, and performance is stablized.

Description

Solving Hessian causes the incompatible methods of hibernate
Technical field
The present invention relates to distributed cloud computing platform technical field, and in particular to realizes distribution side using DUBBO frames The a kind of of face causes the incompatible methods of hibernate for solving Hessian.
Background technology
Hessian is the remoting onhttp instruments of a lightweight, and the work(of RMI is provided using simple method Energy.Compared to WebService, Hessian is simpler, quick.Using binary system RPC agreements, because using binary system Agreement, so it is well suited for sending binary data.
Hibernate is the Object Relation Mapping frame of an open source code, it has carried out JDBC very lightweight Object encapsulation, POJO and database table are established mapping relations by it, are a full automatic orm frames, and hibernate can be with Automatically generate SQL statement, automated execution so that java applet person arbitrary can manipulate number using object Program Thought According to storehouse.Hibernate can be applied in any occasion using JDBC, can both be used in the client-side program of Java, and also might be used To be used in the Web of Servlet/JSP applications, most revolution meaning, Hibernate can be in the J2EE of application EJB Substitute CMP in framework, complete the important task of data persistence.
The content of the invention
The present invention overcomes the deficiencies in the prior art, there is provided a kind of solution Hessian causes the incompatible sides of hibernate Method, when being serialized for solving Hessian, to@OneToMany correspondences in hibernate more than caused by 7 The technical problem of session exceptions.
In view of the above problem of the prior art, disclosed one side, the present invention use following technology according to the present invention Scheme:
A kind of solution Hessian causes the incompatible methods of hibernate, including:
Step 1:One object is passed to and is filtered;
Step 2:Judge whether the object in the step 1 is conventional object, in the feelings that the object is conventional object Under condition, then without traversal;
Step 3:Judge whether the object belongs to collection object again, if collection object, then its aggregates content Traversal comes out, then recurrence again;
Step 4:, it is necessary to determine whether endless loop when recurrence, if endless loop and endless loop exceed certain time Number, then circulation failure;
Step 5:Specifically inside filtering class, judging whether it is Entity.class, if it does, just needing to replace The set element of the inside;
Step 6:The content of set the inside is replaced, after content is replaced, hessian would not report an error.
In order to which the present invention is better achieved, further technical solution is:
An embodiment according to the present invention, in the case that the object in the step 2 is String, Integer, then It need not travel through.
Another according to the present invention embodiment, in the step 4, in the case where endless loop number is more than 9 times, then Circulation failure.
Compared with prior art, one of beneficial effects of the present invention are:
A kind of solution Hessian of the present invention causes the incompatible methods of hibernate, solves Hessian serializings When, session caused more than 7 to@OneToMany correspondences in hibernate closes the problem of abnormal;The present invention is suitable It is using the place of hessian serializings in distributed environment, suitable for dubbo clusters with scope;Developer is facilitated, easily In practicality, performance is stablized.
Brief description of the drawings
, below will be to embodiment for clearer explanation present specification embodiment or technical solution of the prior art Or attached drawing is briefly described needed in the description of the prior art, it should be apparent that, drawings in the following description are only It is the reference to some embodiments in present specification, for those skilled in the art, what is do not made the creative labor In the case of, other attached drawings can also be obtained according to these attached drawings.
Fig. 1 is the FB(flow block) according to one embodiment of the invention.
Embodiment
The present invention is described in further detail with reference to embodiment, but the implementation of the present invention is not limited to this.
As shown in Figure 1, Fig. 1 is the FB(flow block) according to one embodiment of the invention, one kind, which solves Hessian, to be caused Method incompatible hibernate, is when Hessian is serialized ,@OneToMany correspondences in hibernate is exceeded 7 caused session close the solution proposed extremely.Such as in some entity object@Entity, if explaining@ The relation of OneToMany is more than 7.Part so more than 7, Hessian serializings will carry out paging query to it.But When being second of request, the session of hibernate has been switched off, so compatibling problem occurs.It is compatible for this The hibernate proxy class realized is replaced with common collection class by problem, the present invention.Its specific step includes:
Step 1:The method that one object is passed to filtering;
Step 2:It is conventional object to judge this method.For example String Integer these these classes are just not required to To travel through;
Step 3:Judge whether to belong to collection object again, if collection object, then need its aggregates content time Go through out, then recurrence again;
Step 4:, it is necessary to determine whether endless loop when recurrence, if running into endless loop more than 9 times, then circulation Failure;
Step 5:Specifically inside filtering class, judging whether it is Entity.class, if it does, with regard to needing to replace Change the set element of the inside.;
Step 6:Replace the content of set the inside.After content is replaced, hessian would not report an error.
For to sum up, a kind of solution Hessian of the invention causes the incompatible methods of hibernate, solves When Hessian is serialized, session caused more than 7 to@OneToMany correspondences in hibernate closes abnormal Problem;The scope of application of the present invention is using the place of hessian serializings in distributed environment, suitable for dubbo clusters;It is convenient Developer, is easy to practical, performance is stablized.
" one embodiment " for being spoken of in the present specification, " another embodiment ", " embodiment ", etc., refer to tying Specific features, structure or the feature for closing embodiment description are included at least one embodiment of the application generality description In.It is not necessarily to refer to same embodiment that statement of the same race, which occur, in multiple places in the description.Appoint furthermore, it is understood that combining When one embodiment describes a specific features, structure or feature, what is advocated is this to realize with reference to other embodiment Feature, structure or feature are also fallen within the scope of the present invention.
Although reference be made herein to invention has been described for multiple explanatory embodiments of the invention, however, it is to be understood that Those skilled in the art can be designed that a lot of other modifications and embodiment, these modifications and embodiment will fall in this Shen Please be within disclosed spirit and spirit.More specifically, can be to master in the range of disclosure and claim The building block and/or layout for inscribing composite configuration carry out a variety of variations and modifications.Except what is carried out to building block and/or layout Outside variations and modifications, to those skilled in the art, other purposes also will be apparent.

Claims (3)

1. a kind of solution Hessian causes the incompatible methods of hibernate, it is characterised in that including:
Step 1:One object is passed to and is filtered;
Step 2:Judge whether the object in the step 1 is conventional object, in the case where the object is conventional object, Then without traversal;
Step 3:Judge whether the object belongs to collection object again, if collection object, then its aggregates content is traveled through Out, then recurrence again;
Step 4:, it is necessary to determine whether endless loop when recurrence, if endless loop and endless loop exceed certain number, then Circulation failure;
Step 5:Specifically inside filtering class, judging whether it is Entity.class, if it does, just needing to replace the inside Set element;
Step 6:The content of set the inside is replaced, after content is replaced, hessian would not report an error.
2. solution Hessian according to claim 1 causes the incompatible methods of hibernate, it is characterised in that described In the case that object in step 2 is String, Integer, then it need not travel through.
3. solution Hessian according to claim 1 causes the incompatible methods of hibernate, it is characterised in that described In step 4, in the case where endless loop number is more than 9 times, then circulation failure.
CN201711194169.5A 2017-11-24 2017-11-24 Method for solving hibernate incompatibility caused by Hessian Active CN107967328B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711194169.5A CN107967328B (en) 2017-11-24 2017-11-24 Method for solving hibernate incompatibility caused by Hessian

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711194169.5A CN107967328B (en) 2017-11-24 2017-11-24 Method for solving hibernate incompatibility caused by Hessian

Publications (2)

Publication Number Publication Date
CN107967328A true CN107967328A (en) 2018-04-27
CN107967328B CN107967328B (en) 2021-04-02

Family

ID=61997716

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711194169.5A Active CN107967328B (en) 2017-11-24 2017-11-24 Method for solving hibernate incompatibility caused by Hessian

Country Status (1)

Country Link
CN (1) CN107967328B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096584A (en) * 2009-12-15 2011-06-15 阿里巴巴集团控股有限公司 Method, equipment and system for modifying time stamp on page script
US20160212159A1 (en) * 2013-09-12 2016-07-21 Virsec Systems, Inc. Automated runtime detection of malware
CN106933564A (en) * 2015-12-31 2017-07-07 远光软件股份有限公司 The querying method that ECP platform datas are accessed is realized by Fitler models and note extension

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096584A (en) * 2009-12-15 2011-06-15 阿里巴巴集团控股有限公司 Method, equipment and system for modifying time stamp on page script
US20160212159A1 (en) * 2013-09-12 2016-07-21 Virsec Systems, Inc. Automated runtime detection of malware
CN106933564A (en) * 2015-12-31 2017-07-07 远光软件股份有限公司 The querying method that ECP platform datas are accessed is realized by Fitler models and note extension

Also Published As

Publication number Publication date
CN107967328B (en) 2021-04-02

Similar Documents

Publication Publication Date Title
Zhang et al. Research on lightweight MVC framework based on spring MVC and mybatis
CN105955208B (en) Network robot data control system based on cloud platform
AU2017254506B2 (en) Method, apparatus, computing device and storage medium for data analyzing and processing
DE102021129078A1 (en) INTELLIGENT PUSH COUPLING ABOVE THE PLATFORM FOR COOLING SYSTEMS IN DATA CENTERS
CN104267944A (en) Spring-based MVC (model view controller) mode optimization system
CN104036365A (en) Method for constructing enterprise-level data service platform
US20110106853A1 (en) Declarative model security pattern
CN104050261A (en) Stormed-based variable logic general data processing system and method
CN103338135A (en) Real-time monitoring method of cluster storage capacity
CN105718601B (en) A kind of service dynamic integrated model and its application method
CN106227397A (en) Computing cluster job management system based on application virtualization technology and method
CN105468756A (en) Design and realization method for mass data processing system
CN106126564A (en) A kind of method rendered based on dynamic template language
CN103020366B (en) A kind of track traffic BAS system cross platform automatic programming method
CN105824944A (en) XML (X Extensible Markup Language) configuration data maintenance method and system based on scripting language
US10558670B2 (en) Smart tuple condition-based operation performance
CN105138646A (en) Database operation method based on Hibernate
CN110851123A (en) WebGIS power grid visualization framework construction method, system and device based on SpringMVC
CN102541811B (en) On-demand computing-based data analysis device and method for analysis factors
CN103927244A (en) Plug-in scheduling process monitoring method implemented based on dynamic proxy
CN107967328A (en) Solving Hessian causes the incompatible methods of hibernate
CN104408167A (en) Method for expanding sqoop function in Hue based on django
WO2017097125A1 (en) Executive code generation method and device
CN110555152A (en) distributed search system based on Elasticissearch framework
CN1414492A (en) Rosources package and network integration method based on mobile Agent

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant