CN102708175B - Automatic reconnection method and automatic reconnection device for contingency interrupt of database connection - Google Patents

Automatic reconnection method and automatic reconnection device for contingency interrupt of database connection Download PDF

Info

Publication number
CN102708175B
CN102708175B CN201210138481.3A CN201210138481A CN102708175B CN 102708175 B CN102708175 B CN 102708175B CN 201210138481 A CN201210138481 A CN 201210138481A CN 102708175 B CN102708175 B CN 102708175B
Authority
CN
China
Prior art keywords
database
connection request
database connection
connection
pool
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.)
Expired - Fee Related
Application number
CN201210138481.3A
Other languages
Chinese (zh)
Other versions
CN102708175A (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.)
Beihang University
Original Assignee
Beihang University
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 Beihang University filed Critical Beihang University
Priority to CN201210138481.3A priority Critical patent/CN102708175B/en
Publication of CN102708175A publication Critical patent/CN102708175A/en
Application granted granted Critical
Publication of CN102708175B publication Critical patent/CN102708175B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an automatic reconnection method and an automatic reconnection device for contingency interrupt of database connection. The device comprises a regular database connection pool and a standby database connection pool, a connection validity detector, a database connection request monitor, a connection request priority analyzer and an exception catcher; the connection validity detector is used for pre-connection so as to judge the validity of the connection to be allocated currently, and when the regular database connection pool has invalid connection, the standby database connection pool initializes the database connection as needed. According to the method, the time interval between two database connection requests is recorded through the database connection request monitor, the connection request priority analyzer judges the database connection request according to a pre-set priority strategy, and the standby database connection pool is started when the database connection request with higher priority exists. The method and the device ensure that the database connection requests which need to be processed quickly can be executed efficiently, so that the times of pre-connection is controlled effectively, and the system overhead is saved.

Description

A kind of Auto-reconnect method and device thereof that connects accidental interruption for database
Technical field
The invention belongs to microcomputer data processing field, relate to Connectivity Technical of Database, specifically a kind of Auto-reconnect method and device thereof that connects accidental interruption for database.
Background technology
It is a kind of limited resource of key that database connects.The management that database is connected can significantly impact retractility and the robustness of whole application program, has influence on the performance index of program.Database connection pool puts forward for this problem just.
Database connection pool is responsible for distributing, management is connected with release database, and its most basic thought is exactly to set up in advance some connections to be positioned in memory object standby.When application program needs building database to connect, can reuse an existing database and connect, rather than re-establish one; After finishing using, discharge, the database that releasing idling time while exceedes maximum idle time connects, and avoids the database causing because not discharging database connection to connect leakage.Database Connection-Pool Technology has obviously improved the performance of database manipulation.
Connection under ideal state in database connection pool is all effective, but in actual environment, due to reasons such as short interruption, database server that network connects are restarted, database upgrade and database parameter modifications, all can cause the Joint failure in database connection pool.When application program obtains the connection of an inefficacy and is used for carrying out database manipulation from database connection pool, system can be dished out and be connected extremely.And before extremely dishing out, application program is that the validity that cannot connect fetched data storehouse judges.
Generally, for database, connect invalid situation, the mode of processing has two kinds, and one is obviate, and another kind is to remedy afterwards.Obviate referred to before giving application program by connection, to connecting, by pre-connection, was tested and was judged its validity.Remedy to refer in system afterwards and dish out after connection extremely, application program is obtained a new connection automatically again from Data Connection Pool, again connects trial.
No matter be obviate or remedy afterwards, be all not suitable for the user environment that performance is had high requirements.Obviate needs the frequent connection actual database validity to connect in test connection pool, and this continuous connection and release can increase the expense of system.Remedy after catching the exception afterwards, then from connection pool, obtain new connection, again connect, perhaps perhaps failure of success of retry, can not be guaranteed.The delay of time that retry causes, the consumption of resource, can reduce system performance greatly.
Summary of the invention
To the object of the invention is for database, to connect invalid situation in order solving in prior art, to exist the large and retry of system overhead to connect the problem that can not guarantee successful connection, propose a kind of Auto-reconnect method and device thereof that connects accidental interruption for database.
For database, connect an Auto-reconnect device for accidental interruption, comprise database connection pool, connect validity detecting device, database connection request monitor, connection request priority analysis device and exception catching device.
Database connection pool operates on database server, comprises database routine data storehouse connection pool and standby database connection pool.In the connection pool of database routine data storehouse, the database of in store fixed number connects, and when Data Connection Pool initialization, the database in the connection pool of initialization routine data storehouse is connected.
Database connection request monitor detects the database connection request that application program is initiated, and the time interval between twice database connection request before and after record; When database connection request monitor detects database connection request, first detect in the connection pool of current routine data storehouse whether available free connection, if there is no idle connection, wait for, until available free connection, when available free connection, distribute a database to connect to this database connection request, and and according to the time interval between the database connection request of twice of front and back, distributed database is connected to send to and connect validity detecting device and carry out validation checking.Pre-connection is carried out in the database connection that connection validity detecting device distributes routine data storehouse connection pool, the validity connecting to detect the current database being distributed, if connect effectively, distributed database is connected and returns to the database connection request that application program is initiated, if it is invalid to connect, send notice to connection request priority analysis device.Connection request priority analysis device is receiving after the notice that connects validity detecting device, the database connection request of initiating by predefined priority policy application programs judges, when this database connection request belongs to the higher database connection request of priority, send enable command to standby database connection pool.Standby database connection pool is receiving after enable command, carries out initialization, and the database that initialization user sets number connects.
Exception catching device is self-defining exception catching mechanism, for monitor database routine data storehouse connection pool, standby database connection pool, connection validity detecting device, database connection request monitor, connection request priority analysis device and database server, when capturing when abnormal, produce abnormality processing information to user.
An Auto-reconnect method that connects accidental interruption for database, comprises the steps:
Step 1: judge that whether the database connection request of the current initiation of application program is for asking first, if so, routine data storehouse connection pool initialization, circulation creates the database specifying number and connects, and created database is connected and is saved in a data vector, then perform step 2; If not, execution step 3.
Step 2: obtain database connection and distribute to current database connection request from the connection pool of routine data storehouse, if there is no idle connection in the connection pool of current routine data storehouse, wait for, until available free connection in the connection pool of routine data storehouse; The database connection request monitor records time that database connection request is initiated first simultaneously.
Step 3: the time that database connection request monitor records current database connection request is initiated, before and after judging, whether the time interval of twice database connection request is greater than preset value A, if so, proceeds to step 4, otherwise, proceed to step 5; Described preset value A is determined as required by user.
Step 4: connect validity detecting device and detects the validity that the database that distributes connects, connect when effective when detecting this database, proceed to step 5 and carry out, when this database of detection connects when invalid, proceed to step 6 and carry out.
Step 5: use the database being assigned to connect performing database SQL operation, obtain from standby database connection pool if the database being assigned to connects, go to step 8 execution; Otherwise, if connecting, the database being assigned to obtains from the connection pool of routine data storehouse, when database SQL operation runs succeeded, return to operating result, discharge this database and be connected to routine data storehouse connection pool, when database SQL operation carry out unsuccessful, the exception catching device information that catchs the exception, execution step 6.
Step 6: connection request priority analysis device judges database connection request by predefined priority policy, if during the higher database connection request of priority, enable standby database connection pool, in standby database connection pool, create as required and distribute new database to connect, go to step 5 execution, if the database connection request that priority level is lower, enters waiting status, execution step 7.
Step 7: empty routine data storehouse connection pool, then initialization routine data storehouse connection pool, circulation creates the database specifying number and connects, and created database is connected and is saved in a data vector, for the database connection request allocation database of waiting status connects, then go to step 5 execution.
Step 8: after using the database of standby database connection pool to connect to carry out database manipulation to complete, discharging this database is connected in standby database connection pool, after the database connection creating as required in standby database connection pool is all released, empty standby database connection pool.
Advantage of the present invention and good effect are:
(1) Auto-reconnect method of the present invention and device thereof are processed connect the database connection causing because of fail data storehouse extremely on backstage, to user transparent, and have effectively improved effectively connection rate of database, have strengthened user's experience.
(2) Auto-reconnect method of the present invention and device thereof based on obviate and the combination of afterwards remedying the two realize, with respect to obviate, avoided each connection to carry out pre-connection; With respect to remedy afterwards, guaranteed the validity connecting for the second time, avoided the inefficiency because repeatedly retry causes.
(3) set up database connection request monitor, effectively control the number of times of pre-connection, avoid unnecessary system overhead.
(4) introduce priority policy, when pre-connection failure or while distributing Joint failure, for the database connection request that needs emergency treatment, immediately in standby database connection pool, create as required and distribute new database to connect, assurance need to be able to efficient execution by the database connection request of fast processing.
(5) empty in time standby database connection pool, reduce system overhead, guarantee the validity of the database connection of obtaining simultaneously in standby database connection pool.
Accompanying drawing explanation
Fig. 1 is the module diagram of Auto-reconnect device of the present invention;
Fig. 2 is the overall flow chart of steps of Auto-reconnect method of the present invention;
Fig. 3 is the process flow diagram that the present invention monitors adjacent twice database connection request time interval;
Fig. 4 is that the present invention connects validity detecting device and detects the process flow diagram that the database that distributes connects validity;
Fig. 5 is the structural representation of priority policy of the present invention;
Fig. 6 is the schematic flow sheet that the present invention carries out according to priority policy.
Embodiment
Below in conjunction with drawings and Examples, the present invention is described in further detail.
As shown in Figure 1, the Auto-reconnect device for database connection accidental interruption that the present invention proposes, comprises as lower module: database connection pool, connect validity detecting device 3, database connection request monitor 4, connection request priority analysis device 5, and exception catching device 6.Database connection pool comprises routine data storehouse connection pool 1 and standby database connection pool 2.
Routine data storehouse connection pool 1 and standby database connection pool 2 operate on database server 7.In the connection pool 1 of routine data storehouse, the database of in store fixed number connects, and when Data Connection Pool initialization, the database in initialization routine data storehouse connection pool 1 is connected.
Standby database connection pool 2, receiving after the enable command that connection request priority analysis device 5 sends, carries out initialization.Under standby database connection pool 2 usual conditions, be empty, while connecting when occurring in routine data storehouse connection pool 1 losing efficacy, the standby database connection pool 2 as required database of initialization some connects, to guarantee the needing request of rapid-action database manipulation to process immediately.After the database connection creating as required in standby database connection pool 2 is all released, empty standby database connection pool 2, reduced system overhead, guarantee the validity of the connection of obtaining in standby database connection pool 2 simultaneously.
Connecting validity detecting device 3 connects and carries out pre-connection for the database that routine data storehouse connection pool 1 is distributed, the validity connecting to detect the current database being distributed, if connect effectively, distributed database is connected and returns to the database connection request that application program is initiated, if it is invalid to connect, send notice to connection request priority analysis device 5.
The database connection request that database connection request monitor 4 is initiated for detection of application program, and the time interval between twice database connection request before and after record.When application program need to be carried out database manipulation, send a database connection request, database connection request monitor 4 detects after this database connection request, first detect in current routine data storehouse connection pool 1 whether available free connection, if available free connection, distribute a database to connect to this database connection request, and distributed database is connected and sends to connection validity detecting device 3 to carry out validation checking.If there is no idle connection, wait for, until available free connection in routine data storehouse connection pool 1.After application program completes the operation of database, database connection is released back in connection pool, for other operation, uses.In database connection request monitor 4, be provided with two time variable Tlast and Tnow, when application program is initiated database connection request first, record the time of current database connection request, assignment is given two time variable Tlast and Tnow simultaneously, when application program is not while initiating first database connection request, the value assignment of time variable Tnow, to time variable Tlast, is recorded to the time of current database connection request, and assignment is to time variable Tnow simultaneously; Difference between time variable Tnow and Tlast is exactly the time interval of adjacent twice database connection request, the time interval obtaining and preset value A are compared, when interval greater than preset value A, by connection validity detecting device 3, detect routine data storehouse connection pool 1 and distribute to the validity that the database of current database connection request connects; Otherwise, when the time interval is less than or equal to preset value A, directly use the database being assigned to from routine data storehouse connection pool 1 to connect performing database SQL operation.
Connection request priority analysis device 5 is receiving after the notice that connects validity detecting device 3, the database connection request of initiating by predefined priority policy application programs judges, when this database connection request belongs to the higher database connection request of priority, send enable command to standby database connection pool 2.Described predefined priority policy is set according to the actual requirements, and for example, the priority of setting write operation is greater than the priority of read operation, and the database connection request of write operation belongs to the database connection request that priority is higher.
Exception catching device 6 connects abnormal for acquisition database, the modules to Auto-reconnect device of the present invention and database server 7 are monitored, and preset processing, avoid system throw exception, reduces user and experiences.Exception catching device 6 is a self-defining exception catching mechanism, when capturing when abnormal, according to default, process, or generation abnormality processing information is to user.For example, when connecting database that validity detecting device 3 detects, connect when invalid, exception catching device 6 is caught this database and is connected invalid abnormal information, and processes according to default, starts the priority of connection request priority analysis device 5 analytical database connection requests.
As shown in Figure 2, the Auto-reconnect method for database connection accidental interruption that the present invention proposes, comprises the steps.
Step 1: judge that whether the database connection request of the current initiation of application program is for asking first, if application program is to initiate first database connection request, connection pool 1 initialization of routine data storehouse, circulation creates the database specifying number and connects, and these connections are put into the data vector for preserving connection, then perform step two, if not request first, execution step three.
Step 2: obtain database connection and distribute to current database connection request from routine data storehouse connection pool 1, database connection request monitor 4 records the time that database connection request is initiated first.If there is no idle connection in current routine data storehouse connection pool 1, wait for, until available free connection in routine data storehouse connection pool 1.When the connection pool 1 available free connection of routine data storehouse, connect to current database connection request allocation database.
Step 3: database connection request monitor 4 records the time that current database connection request is initiated, and compare with the time that the last time of recording, database connection request was initiated, if the twice database connection request in front and back interval greater than preset value A, proceed to step 4, otherwise, proceed to step 5.Preset value A is adjustable, by user, according to actual conditions, is determined, for example, be set to 15 minutes.
As shown in Figure 3, in database connection request monitor 4, be provided with two time variable Tlast and Tnow, for recording the time of adjacent twice database connection request.Detailed process is:
Step 3.1: judge that whether the database connection request of the current initiation of application program is for asking first, if database connection request first proceeds to step 3.2; Otherwise, proceed to step 3.3.
Step 3.2: record the time of current database connection request, assignment is given two time variable Tlast and Tnow simultaneously.
Step 3.3: the value assignment of time variable Tnow, to time variable Tlast, is recorded to the time of current database connection request, and assignment is to time variable Tnow simultaneously.
Difference between step 3.4: time variable Tnow and Tlast is exactly the time interval of adjacent twice database connection request.
Step 3.5: the time interval obtaining and preset value A are compared.
Step 4: connect validity detecting device 3 and detect the validity that distributed database connects, connect when effective when detecting this database, proceed to step 5 and carry out; When detecting this database, connect when invalid, proceed to step 6 and carry out.
As shown in Figure 4, the validity that connection validity detecting device 3 Test databases connect is specifically divided into following steps:
Step 4.1: create the static SQL statements that connects validity for detection of distributed database.
Step 4.2: pass through distributed database and connect, carry out static SQL statements, if run succeeded, proceed to step 4.3; Otherwise, proceed to step 4.4.
Step 4.3: run succeeded, return to and close the Statement object of the result that generates after carrying out, database connects effectively, execution step five.
Step 4.4: carry out unsuccessfully, catch the exception, it is invalid that database connects, execution step six.
Step 5: use the database being assigned to connect performing database SQL operation, if connecting from standby database connection pool 2, the database being assigned to obtains, proceed to step 8 and carry out, if the database being assigned to connects from routine data storehouse connection pool 1, obtain, if run succeeded, return to operating result, discharge this database and be connected in routine data storehouse connection pool 1, if carry out unsuccessful, exception catching device 6 information that catchs the exception, prepare again to connect, proceed to step 6 and carry out.
Step 6: connection request priority analysis device 5 judges database connection request by predefined priority policy, if during the higher database connection request of priority, enables standby database connection pool 2.Immediately in standby database connection pool 2, create as required and distribute new database to connect, proceeding to step 5 and carry out.The database connection request that priority level is lower enters waiting status, proceeds to step 7.
As shown in Figure 5, the structure of priority policy consists of four parts, strategy names, policy attribute, tactful left part and tactful right part.Wherein policy attribute is option.The agent structure of strategy is " if..else ... " form, if strategy left part else strategy right part.Strategy left part is the default all Rule of judgment of logical OR.User sets and needs rapid-action database connection request according to actual conditions.Connection request priority analysis device 5 reads default Rule of judgment, and dress changes the policy statement that meets form into.
As shown in Figure 6, the fact is the operational attribute in database connection request, for example: reading and writing, insertion, deletion etc., strategy and the fact are matched, if true, meet a certain or multiple condition comprising in strategy, the database connection request priority level of this fact correspondence is higher, OnNow standby database connection pool 2, and be that database of this database connection request initialization connects.If do not mate, the database connection request priority level of this fact correspondence is not high, and request proceeds to waiting status.
Step 7: empty routine data storehouse connection pool, carry out initialization operation, circulation creates the database specifying number and connects, and these databases are connected to the data vector of putting into for preserving connection.And be the database connection request allocation database connection of waiting status, then go to step five execution.
Step 8: after using the database of standby database connection pool 2 to connect to carry out database manipulation to complete, discharging this database is connected in standby database connection pool 2, after the database connection creating as required in standby database connection pool 2 is all released, empty standby database connection pool 2.
In routine data storehouse connection pool 1, there is the restriction of maximum number of connections and minimum linking number, when initialization, routine data storehouse connection pool 1 at least wants the database of the minimum connection pool number of initialization to connect, and standby database connection pool 2 does not have the restriction of database linking number.Standby database connection pool 2 as required instant one or several database of initialization connects, assurance need to be able to efficient execution by the database connection request of fast processing, and after being finished, empties, save system overhead, also guaranteed the validity that wherein database connects.Therefore, for medium-and-large-sized system, the present invention adopts the setting of standby database connection pool 2, database joint efficiency is had comparatively considerablely and improve.

Claims (6)

1. one kind connects the Auto-reconnect device of accidental interruption for database, it is characterized in that, this device comprises as lower module: database connection pool, connection validity detecting device (3), database connection request monitor (4), connection request priority analysis device (5) and exception catching device (6); It is upper that database connection pool operates in database server (7), comprises routine data storehouse connection pool (1) and standby database connection pool (2); In routine data storehouse connection pool (1), the database of in store fixed number connects, and when Data Connection Pool initialization, the database in initialization routine data storehouse connection pool (1) is connected;
Database connection request monitor (4) detects the database connection request that application program is initiated, and the time interval between twice database connection request before and after record; When database connection request monitor (4) detects database connection request, first detect in current routine data storehouse connection pool (1) whether available free connection, if there is no idle connection, wait for, until available free connection, if available free connection, distribute a database to connect to this database connection request, and according to the time interval between the database connection request of twice of front and back, distributed database is connected to send to and connect validity detecting device (3) and carry out validation checking; Pre-connection is carried out in the database connection that connection validity detecting device (3) distributes routine data storehouse connection pool (1), the validity connecting to detect the current database being distributed, if connect effectively, distributed database is connected and returns to the database connection request that application program is initiated, if it is invalid to connect, send notice to connection request priority analysis device (5); Connection request priority analysis device (5) is receiving after the notice that connects validity detecting device (3), the database connection request of initiating by predefined priority policy application programs judges, when this database connection request belongs to the higher database connection request of priority, send enable command to standby database connection pool (2); Standby database connection pool (2) is receiving after enable command, carries out initialization, and the database that initialization user sets number connects;
Exception catching device (6) is self-defining exception catching mechanism, be used for monitoring routine data storehouse connection pool (1), standby database connection pool (2), connect validity detecting device (3), database connection request monitor (4), connection request priority analysis device (5) and database server (7), when capturing database, connect when abnormal, produce abnormality processing information to user.
2. a kind of Auto-reconnect device that connects accidental interruption for database according to claim 1, it is characterized in that, described database connection request monitor (4), be provided with two time variable Tlast and Tnow, when application program is initiated database connection request first, record the time of current database connection request, assignment is given two time variable Tlast and Tnow simultaneously, when application program is not while initiating first database connection request, by the value assignment of time variable Tnow to time variable Tlast, record the time of current database connection request, assignment is to time variable Tnow simultaneously, difference between time variable Tnow and Tlast is exactly the time interval of adjacent twice database connection request, the time interval obtaining and preset value A are compared, when interval greater than preset value A, by connecting validity detecting device (3) detection routine data storehouse connection pool (1), distribute to the validity of the database connection of current database connection request, otherwise, directly use the database being assigned to connect and carry out SQL operation.
3. a kind of Auto-reconnect device that connects accidental interruption for database according to claim 1, is characterized in that, described standby database connection pool (2), after the database connection in it is all released, is cleared.
4. the Auto-reconnect method for database connection accidental interruption based on Auto-reconnect device claimed in claim 1, is characterized in that, comprises the steps:
Step 1: judge that whether the database connection request of the current initiation of application program is for asking first, if, routine data storehouse connection pool (1) initialization, circulation creates the database specifying number and connects, and created database is connected and is saved in a data vector, then perform step 2; If not, execution step 3;
Step 2: obtain database connection and distribute to current database connection request from routine data storehouse connection pool (1), if there is no idle connection in current routine data storehouse connection pool (1), wait for, until available free connection in routine data storehouse connection pool (1); Database connection request monitor (4) records the time that database connection request is initiated first simultaneously;
Step 3: database connection request monitor (4) records the time that current database connection request is initiated, before and after judging, whether the time interval of twice database connection request is greater than preset value A, if so, proceeds to step 4, otherwise, proceed to step 5; Described preset value A is determined as required by user;
Step 4: connect validity detecting device (3) and detects the validity that the database that distributes connects, connect when effective when detecting this database, proceed to step 5 and carry out, when this database of detection connects when invalid, proceed to step 6 and carry out;
Step 5: use the database being assigned to connect and carry out SQL operation, obtain if the database being assigned to connects from standby database connection pool (2), go to step 8 execution; Otherwise, if connecting from routine data storehouse connection pool (1), the database being assigned to obtains, when SQL operation runs succeeded, return to operating result, discharge this database and be connected to routine data storehouse connection pool (1), when SQL operation carry out unsuccessful, exception catching device (6) information that catchs the exception, execution step 6;
Step 6: connection request priority analysis device (5) judges database connection request by predefined priority policy, if during the higher database connection request of priority, enable standby database connection pool (2), in standby database connection pool (2), create as required and distribute new database to connect, go to step 5 execution, if the database connection request that priority level is lower, enters waiting status, execution step 7;
Step 7: empty routine data storehouse connection pool (1), then initialization routine data storehouse connection pool (1), circulation creates the database specifying number and connects, and created database is connected and is saved in a data vector, for the database connection request allocation database of waiting status connects, then go to step 5 execution;
Step 8: use the database of standby database connection pool (2) to connect to carry out after database manipulation completes, discharging this database is connected in standby database connection pool (2), after the database connection creating as required in standby database connection pool (2) is all released, empty standby database connection pool (2).
5. the Auto-reconnect method that connects accidental interruption for database according to claim 4, it is characterized in that, before and after database connection request monitor (4) described in step 3 judges, whether the time interval of twice database connection request is greater than preset value A, and detailed process is:
Step 3.1: judge that whether the database connection request of the current initiation of application program is for asking first, if database connection request first proceeds to step 3.2; Otherwise, proceed to step 3.3;
Step 3.2: record the time of current database connection request, simultaneously assignment is to two time variable Tlast that arrange in database connection request monitor (4) and Tnow;
Step 3.3: the value assignment of time variable Tnow, to time variable Tlast, is recorded to the time of current database connection request, and assignment is to time variable Tnow simultaneously;
Difference between step 3.4: time variable Tnow and Tlast is exactly the time interval of adjacent twice database connection request;
Step 3.5: the time interval obtaining and preset value A are compared.
6. the Auto-reconnect method that connects accidental interruption for database according to claim 4, is characterized in that, the connection validity detecting device (3) described in step 4 detects the validity of the database connection distributing, and concrete steps are:
Step 4.1: create static SQL statements;
Step 4.2: connect by database to be allocated, carry out static SQL statements, if run succeeded, proceed to step 4.3; Otherwise, proceed to step 4.4;
Step 4.3: run succeeded, return to and close the Statement object of the result that generates after carrying out, database to be allocated connects effectively, proceeds to step 5;
Step 4.4: carry out unsuccessfully, exception catching device (6) catchs the exception, it is invalid that database to be allocated connects, and proceeds to step 6.
CN201210138481.3A 2012-05-07 2012-05-07 Automatic reconnection method and automatic reconnection device for contingency interrupt of database connection Expired - Fee Related CN102708175B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210138481.3A CN102708175B (en) 2012-05-07 2012-05-07 Automatic reconnection method and automatic reconnection device for contingency interrupt of database connection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210138481.3A CN102708175B (en) 2012-05-07 2012-05-07 Automatic reconnection method and automatic reconnection device for contingency interrupt of database connection

Publications (2)

Publication Number Publication Date
CN102708175A CN102708175A (en) 2012-10-03
CN102708175B true CN102708175B (en) 2014-04-30

Family

ID=46900941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210138481.3A Expired - Fee Related CN102708175B (en) 2012-05-07 2012-05-07 Automatic reconnection method and automatic reconnection device for contingency interrupt of database connection

Country Status (1)

Country Link
CN (1) CN102708175B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103810203B (en) * 2012-11-13 2018-02-27 深圳市腾讯计算机系统有限公司 A kind of data base management system connection multiplexing method and device
CN104539713B (en) * 2014-12-31 2018-10-09 北京奇虎科技有限公司 service request processing method and device
CN104980524A (en) * 2015-07-10 2015-10-14 上海新炬网络信息技术有限公司 Method for monitoring failure of weblogic connection pool
CN109002373A (en) * 2018-07-24 2018-12-14 阿里巴巴集团控股有限公司 Database connects abnormality eliminating method and device
CN109274641A (en) * 2018-08-09 2019-01-25 广东神马搜索科技有限公司 Connection method and device, calculating equipment and storage medium between client and service node
CN110019487A (en) * 2018-08-16 2019-07-16 联动优势电子商务有限公司 A kind of database connection management method and device
CN109800067A (en) * 2018-12-15 2019-05-24 中国平安人寿保险股份有限公司 Database connection optimization method, device and relevant device based on cloud monitoring
CN112817933A (en) * 2020-12-30 2021-05-18 国电南京自动化股份有限公司 Management method and device for elastic database connection pool
CN116737818B (en) * 2023-08-15 2023-12-22 浩鲸云计算科技股份有限公司 Connection leakage detection method and system for draid database connection pool

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0457112A2 (en) * 1990-05-16 1991-11-21 International Business Machines Corporation Asynchronous resynchronization of a commit procedure
CN102243651A (en) * 2011-06-16 2011-11-16 苏州阔地网络科技有限公司 Database connection control management method and device
CN102346767A (en) * 2011-09-19 2012-02-08 北京金和软件股份有限公司 Database connection method based on double connection pools

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0457112A2 (en) * 1990-05-16 1991-11-21 International Business Machines Corporation Asynchronous resynchronization of a commit procedure
CN102243651A (en) * 2011-06-16 2011-11-16 苏州阔地网络科技有限公司 Database connection control management method and device
CN102346767A (en) * 2011-09-19 2012-02-08 北京金和软件股份有限公司 Database connection method based on double connection pools

Also Published As

Publication number Publication date
CN102708175A (en) 2012-10-03

Similar Documents

Publication Publication Date Title
CN102708175B (en) Automatic reconnection method and automatic reconnection device for contingency interrupt of database connection
US7418627B2 (en) Cluster system wherein failover reset signals are sent from nodes according to their priority
US11016956B2 (en) Database management system with database hibernation and bursting
US10440136B2 (en) Method and system for resource scheduling
US10545807B2 (en) Method and system for acquiring parameter sets at a preset time interval and matching parameters to obtain a fault scenario type
US7567514B2 (en) RAID apparatus, and communication-connection monitoring method and program
CN106202444A (en) A kind of implementation method of data base's O&M monitoring
CN110362402B (en) Load balancing method, device, equipment and readable storage medium
CN100583782C (en) Software upgrade method and device
CN106959895B (en) Resource scheduling method and system for quickly releasing threads
CN110704287B (en) RAID card abnormal log collection method and system under Linux system and storage medium
CN110704228B (en) Solid state disk exception handling method and system
CN111625383B (en) Process exception event processing method and device, electronic equipment and storage medium
US20120072779A1 (en) Memory leak monitoring device and method for monitoring memory leak
US20080215771A1 (en) Pool i/o device operation confirmation method and computer system
CN101094091A (en) Device and method of multipoint control
CN113157411B (en) Celery-based reliable configurable task system and device
CN104158843A (en) Storage unit invalidation detecting method and device for distributed file storage system
US8595404B2 (en) Method and apparatus for device dynamic addition processing, and method and apparatus for device dynamic removal processing
CN115190044B (en) Device connection state checking method, device and storage medium
CN104504348B (en) A kind of data guard method based on high availability storage system
CN111723064A (en) Log collection method and device, server and storage medium
CN101369238A (en) Exception monitoring and reset processing method for USB equipment
CN108563402A (en) A kind of method and system automatically configuring RAID card parameter
CN108924013B (en) Network flow accurate acquisition method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140430

Termination date: 20200507