Movatterモバイル変換


[0]ホーム

URL:


CN105095438A - Data management method and system based on .NET database connection pools - Google Patents

Data management method and system based on .NET database connection pools
Download PDF

Info

Publication number
CN105095438A
CN105095438ACN201510437168.3ACN201510437168ACN105095438ACN 105095438 ACN105095438 ACN 105095438ACN 201510437168 ACN201510437168 ACN 201510437168ACN 105095438 ACN105095438 ACN 105095438A
Authority
CN
China
Prior art keywords
database
connection
connection pool
pool
combining
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.)
Pending
Application number
CN201510437168.3A
Other languages
Chinese (zh)
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.)
Beijing Anniu Yunshang Technology Co Ltd
Original Assignee
Beijing Anniu Yunshang Technology 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 Beijing Anniu Yunshang Technology Co LtdfiledCriticalBeijing Anniu Yunshang Technology Co Ltd
Priority to CN201510437168.3ApriorityCriticalpatent/CN105095438A/en
Publication of CN105095438ApublicationCriticalpatent/CN105095438A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

The invention brings forward a data management method and system based on .NET database connection pools. The database management system based on the NET databases execute following steps: establishing a connecting pool according to a connecting string under the first request for database connection; creating a thread for a connecting request when the connecting request is received by a user; searching for connecting pools in order to know whether databases in the idle state are present to connected with databases and distributing databases to threads for connection if present; recalling data by threads according to distributed connection database; and releasing databases and connecting to connecting pools after threads finish fulfilling functions corresponding to connecting requests. The data management method and system based on the .NET database connection pools have following characteristics: accurate positioning operation is achieved; user experience is enhanced; response speed user experience speed are high; safety of user data is improved; and efficiency and scalability of application programs are enhanced.

Description

A kind of data managing method based on .NET database connection pool and system
Technical field
The present invention relates to database technical field, particularly a kind of data managing method based on .NET database connection pool and system.
Background technology
Connection data storehouse is at substantial resource and relatively slow operation in application program, but they are again crucial.Connection pool is a container of that opened and reusable DataBase combining.Connection pool just discharges when all DataBase combining are all closed from internal memory.Use the most basic advantage of connection pool to be improve performance and the scalability of application program, and always its major defect has one or more DataBase combining to stay open state, even if current not in use.The DataProviders of ADO.NET will use connection pool by under default situations, if do not want to use connection pool, must specify in connection string " Polling=false ".
Flourish along with internet, database security and the stable favor being more and more subject to everybody, the connected mode of current same domain roughly has:
(1) JDBC database connection pool
Ecosystem database connection pool, does not do any encapsulation to data cube computation, and corresponding developer brings very large complexity, and tempo of development is slow, programming reusability is few.(most of enterprise has done the encapsulation of basic energy to it)
(2) DBCP Data Connection Pool
DBCP (DataBaseconnectionpool), database connection pool.Being a java connection pool project on apache, is also the Pool Component that tomcat uses.Be used alone dbcp and need 3 bag: common-dbcp.jar, common-pool.jar, common-collections.jar is the behavior in a cost source very consuming time because building database connects, so by connection pool, with Database, some connect in advance, be placed in internal memory, in connection pool, directly apply for one when application program needs building database to connect just, put back to again after being finished.
(3)c3p0
C3P0 is a JDBC connection pool of increasing income, and it achieves data source and JNDI binding, supports the standard extension of JDBC3 specification and JDBC2.Its open source projects of current use has Hibernate, Spring etc.
(4) .Net database connection pool
Database connection pool value is generally carry out value line by line, cannot determine the accuracy of data like this, if but improperly use connection pool may bring negative effects to application program, not only improper use connection pool is not useful and is harmful.
Summary of the invention
Object of the present invention is intended at least solve one of described technological deficiency.
For this reason, the object of the invention is to propose a kind of data managing method based on .NET database connection pool and system, there is accurate positioning, promote Consumer's Experience, fast response time, Consumer's Experience speed are fast, secure user data and improve the efficiency of application program and the feature of scalability.
To achieve these goals, the embodiment of one aspect of the present invention provides a kind of data managing method based on .NET database connection pool, performs following steps by .NET wide area information server management system:
The connection string that described data base management system (DBMS) connects according to first time requested database connects pond, and described connection pool comprises the DataBase combining of multiple idle condition;
Described data base management system (DBMS) after receiving the connection request of user, for described connection request creates a thread;
Described thread sends connection application request to described database connection pool;
Described data base management system (DBMS), after the connection application request receiving described thread, searches the DataBase combining of whether available free state from described connection pool, if had, connect to described thread allocation database;
Described thread carries out data call with function corresponding to the connection request performing described user according to the described DataBase combining of described distribution, and wherein, described DataBase combining is according to ranks and the mode of getting carries out value;
Described thread, after the function that complete described connection request is corresponding, discharges described DataBase combining to described connection pool.
Further, described DataBase combining is according to ranks and the mode of getting carries out value, comprising: adopt ranks interleaved mode to carry out value.
Further, described connection pool also comprises: the DataBase combining of open mode and reusable state.
Further, described data base management system (DBMS) detect carry new connection string in described connection application request time, wherein, the connection string that the first time requested database that this new connection string is corresponding from the described connection pool set up connects is different, then set up a new connection pool, and allocation database connects the connection application request carrying new connection string with response from this new connection pool.
Further, also comprise the steps: that described data base management system (DBMS) is when user's inoperation database being detected, discharges DataBase combining automatically.
The present invention's embodiment on the other hand provides a kind of data management system based on .NET database connection pool, comprise: connection pool sets up unit, for the pond that connects according to the connection string of first time requested database connection, described connection pool comprises the DataBase combining of multiple idle condition; Thread creation unit, for after receiving the connection request of user, for described connection request creates a thread; DataBase combining administrative unit, for after the connection application request receiving described thread, searches the DataBase combining of whether available free state from described connection pool, if had, connect to described thread allocation database; Wherein, described thread carries out data call with function corresponding to the connection request performing described user according to the described DataBase combining of described distribution, wherein, described DataBase combining is according to ranks and the mode of getting carries out value, described thread, after the function that complete described connection request is corresponding, discharges described DataBase combining to described connection pool.
Further, described DataBase combining is according to ranks and the mode of getting carries out value, comprising: adopt ranks interleaved mode to carry out value.
Further, described connection pool also comprises: the DataBase combining of open mode and reusable state.
Further, described connection pool set up unit also for detect carry new connection string in the described connection application request from thread time, wherein, the connection string that the first time requested database that this new connection string is corresponding from the described connection pool set up connects is different, then set up a new connection pool, and connect by described DataBase combining administrative unit allocation database from this new connection pool the connection application request carrying new connection string with response.
Further, described DataBase combining administrative unit also for when user's inoperation database being detected, discharges DataBase combining automatically.
According to the data managing method based on .NET database connection pool and the system of the embodiment of the present invention, combine based on JDBC and .net technology and a set of DataBase combining instrument editing out, achieve cross-platform, cross-cutting, its expansion, there is special value mode, common database connection pool value is generally value line by line, the accuracy of such data be can not determine, this sets of data storehouse connection pool not only obtains largest optimization to DataBase combining amount, and the accuracy that special process (ranks are also got) ensures data be have also been made to peek, and can automatic release connection when database does not connect.The present invention can the data that send request of disposable reading user, have accurate positioning, promote Consumer's Experience, fast response time, Consumer's Experience speed are fast, secure user data and improve the efficiency of application program and the feature of scalability.
The aspect that the present invention adds and advantage will part provide in the following description, and part will become obvious from the following description, or be recognized by practice of the present invention.
Accompanying drawing explanation
Above-mentioned and/or additional aspect of the present invention and advantage will become obvious and easy understand from accompanying drawing below combining to the description of embodiment, wherein:
Fig. 1 is the process flow diagram of the data managing method based on .NET database connection pool according to the embodiment of the present invention;
Fig. 2 is the schematic diagram of the data managing method based on .NET database connection pool according to the embodiment of the present invention;
Fig. 3 is the structural drawing of the data management system based on .NET database connection pool according to the embodiment of the present invention.
Embodiment
Be described below in detail embodiments of the invention, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has element that is identical or similar functions from start to finish.Be exemplary below by the embodiment be described with reference to the drawings, be intended to for explaining the present invention, and can not limitation of the present invention be interpreted as.
As shown in Figure 1, the data managing method based on .NET database connection pool of the embodiment of the present invention performs following steps by .NET wide area information server management system:
Step S1, the connection string that data base management system (DBMS) connects according to first time requested database connects pond.
Particularly, connection pool is created by a unique connection string.In this step, data base management system (DBMS) is the connection pool that the connection string connected according to first time requested database creates.Wherein, connection pool comprises the DataBase combining of multiple idle condition.In addition, connection pool can also comprise: the DataBase combining of open mode and reusable state.
It should be noted that can there be multiple connection pool in synchronization same application territory, but connection pool cannot be shared across Application Domain.When the connection string requested database that another one is different connects, another connection pool will be created.Therefore a corresponding connection pool instead of a corresponding connection pool of database in a concatenation character.
In one embodiment of the invention, data base management system (DBMS) detect in connection application request carry new connection string time, wherein, the connection string that the first time requested database that this new connection string is corresponding from the connection pool set up connects is different, then set up a new connection pool, and allocation database connects the connection application request carrying new connection string with response from this new connection pool.
In other words, the connection pool of .Net database is the container of database connection object, if wherein existence activity or the connection of opening its maintain active state.When use connection string carrys out requested database connection, by connection pool new for distribution one.By using identical connection string in the application, performance and the scalability of application program can be improved.
Step S2, data base management system (DBMS) after receiving the connection request of user, for this connection request creates a thread.
Fig. 2 is the schematic diagram of the data managing method based on .NET database connection pool according to the embodiment of the present invention.
As shown in Figure 2, data base management system (DBMS) can receive the connection request of one or more user, the connection request of such as, two users in Fig. 2.Data base management system (DBMS), according to the connection request receiving two users (user 1 and user 2), is respectively each connection request and creates a thread, be i.e. thread 1 and thread 2.
Step S3, thread sends connection application request to database connection pool.
With reference to figure 2, thread 1 and thread 2, respectively according to the connection request of respective respective user, send connection application request to database connection pool, to apply for connecting.
Step S4, data base management system (DBMS), after the connection application request receiving thread, is searched the DataBase combining of whether available free state, if had, is connected to thread allocation database from connection pool.
In this step, DataBase combining, after the DataBase combining finding available free state in connection pool, is distributed to each thread by data base management system (DBMS).
Step S5, thread carries out data call with function corresponding to the connection request performing user according to the DataBase combining distributed.
In this step, each thread utilizes data base management system (DBMS) to the DataBase combining distributed separately, performs the function that the connection request of respective user is corresponding.
In one embodiment of the invention, DataBase combining is according to ranks and the mode of getting carries out value.Particularly, DataBase combining is according to ranks and the mode of getting carries out value, comprising: adopt ranks interleaved mode to carry out value.This reading data mode can realize, to the accurate reading of data, guaranteeing not obliterated data.
Step S6, thread is after the function that complete connection request is corresponding, and release DataBase combining is to connection pool.
In yet another embodiment of the present invention, data base management system (DBMS), when user's inoperation database being detected, discharges DataBase combining automatically.
As shown in Figure 3, the embodiment of the present invention also proposes a kind of data management system based on .NET database connection pool, comprising: connection pool sets up unit 1, thread creation unit 2 and DataBase combining administrative unit 3.
Particularly, connection pool sets up unit 1 for the pond that connects according to the connection string of first time requested database connection.
Connection pool is created by a unique connection string.In this step, data base management system (DBMS) is the connection pool that the connection string connected according to first time requested database creates.Wherein, connection pool comprises the DataBase combining of multiple idle condition.Further, connection pool also comprises: the DataBase combining of open mode and reusable state.
It should be noted that can there be multiple connection pool in synchronization same application territory, but connection pool cannot be shared across Application Domain.When the connection string requested database that another one is different connects, another connection pool will be created.Therefore a corresponding connection pool instead of a corresponding connection pool of database in a concatenation character.
In one embodiment of the invention, connection pool set up unit 1 detect in connection application request carry new connection string time, wherein, the connection string that the first time requested database that this new connection string is corresponding from the connection pool set up connects is different, then set up a new connection pool, and allocation database connects the connection application request carrying new connection string with response from this new connection pool.
In other words, the connection pool of .Net database is the container of database connection object, if wherein existence activity or the connection of opening its maintain active state.When use connection string carrys out requested database connection, by connection pool new for distribution one.By using identical connection string in the application, performance and the scalability of application program can be improved.
Thread creation unit 2 for after receiving the connection request of user, for connection request creates a thread.
Particularly, thread creation unit 2 can receive the connection request of one or more user, the connection request of such as, two users in Fig. 2.Data base management system (DBMS), according to the connection request receiving user, is respectively each connection request and creates a thread.Each thread, respectively according to the connection request of respective respective user, sends connection application request to DataBase combining administrative unit 3, to apply for connecting.
DataBase combining administrative unit 3, for after the connection application request receiving thread, is searched the DataBase combining of whether available free state, if had, is connected to thread allocation database from connection pool.
Each thread utilizes data base management system (DBMS) to the DataBase combining distributed separately, performs the function that the connection request of respective user is corresponding.
In one embodiment of the invention, DataBase combining is according to ranks and the mode of getting carries out value.Particularly, DataBase combining is according to ranks and the mode of getting carries out value, comprising: adopt ranks interleaved mode to carry out value.This reading data mode can realize, to the accurate reading of data, guaranteeing not obliterated data.
Thread is after the function that complete connection request is corresponding, and release DataBase combining is to connection pool.In one embodiment of the invention, DataBase combining administrative unit 3 also for when user's inoperation database being detected, discharges DataBase combining automatically.
To sum up, connection pool provides the idle reusable DataBase combining opened, and no longer needs to open a DataBase combining request msg database data is stylish at every turn.When DataBase combining close or release time, will turn back in connection pool, and again keep idle condition until new connection request arrives, effectively use connection pool, opening and closing database will no longer very consumes resources, the efficiency of raising application program and scalability.
According to the data managing method based on .NET database connection pool and the system of the embodiment of the present invention, combine based on JDBC and .net technology and a set of DataBase combining instrument editing out, achieve cross-platform, cross-cutting, its expansion, there is special value mode, common database connection pool value is generally value line by line, the accuracy of such data be can not determine, this sets of data storehouse connection pool not only obtains largest optimization to DataBase combining amount, and the accuracy that special process (ranks are also got) ensures data be have also been made to peek, and can automatic release connection when database does not connect.The present invention can the data that send request of disposable reading user, have accurate positioning, promote Consumer's Experience, fast response time, Consumer's Experience speed are fast, secure user data and improve the efficiency of application program and the feature of scalability.
In the description of this instructions, specific features, structure, material or feature that the description of reference term " embodiment ", " some embodiments ", " example ", " concrete example " or " some examples " etc. means to describe in conjunction with this embodiment or example are contained at least one embodiment of the present invention or example.In this manual, identical embodiment or example are not necessarily referred to the schematic representation of above-mentioned term.And the specific features of description, structure, material or feature can combine in an appropriate manner in any one or more embodiment or example.
Although illustrate and describe embodiments of the invention above, be understandable that, above-described embodiment is exemplary, can not be interpreted as limitation of the present invention, those of ordinary skill in the art can change above-described embodiment within the scope of the invention when not departing from principle of the present invention and aim, revising, replacing and modification.Scope of the present invention is by claims extremely equivalency.

Claims (10)

CN201510437168.3A2015-07-232015-07-23Data management method and system based on .NET database connection poolsPendingCN105095438A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201510437168.3ACN105095438A (en)2015-07-232015-07-23Data management method and system based on .NET database connection pools

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201510437168.3ACN105095438A (en)2015-07-232015-07-23Data management method and system based on .NET database connection pools

Publications (1)

Publication NumberPublication Date
CN105095438Atrue CN105095438A (en)2015-11-25

Family

ID=54575875

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201510437168.3APendingCN105095438A (en)2015-07-232015-07-23Data management method and system based on .NET database connection pools

Country Status (1)

CountryLink
CN (1)CN105095438A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106354801A (en)*2016-08-262017-01-25广州唯品会信息科技有限公司Distributed database connection method and device
CN106484882A (en)*2016-10-142017-03-08腾讯科技(深圳)有限公司A kind of management method of database connection pool and device
CN110300176A (en)*2019-07-022019-10-01斯德沃(深圳)网络科技有限公司A kind of working method and database RPC service device of database RPC service device
CN111225007A (en)*2018-11-262020-06-02北京京东尚科信息技术有限公司Database connection method, device and system
CN114500628A (en)*2021-12-302022-05-13天翼云科技有限公司Connection selection method and device
CN119203217A (en)*2024-09-042024-12-27中国银联股份有限公司 Distributed data node access method, device, equipment, system and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101883080A (en)*2009-05-082010-11-10北京正辰科技发展有限责任公司Safety management system in oppoLMS (Learning Management System)
CN102880475A (en)*2012-10-232013-01-16上海普元信息技术股份有限公司Real-time event handling system and method based on cloud computing in computer software system
CN102945264A (en)*2012-10-242013-02-27浪潮集团山东通用软件有限公司Method for intelligently starting distributed transaction

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101883080A (en)*2009-05-082010-11-10北京正辰科技发展有限责任公司Safety management system in oppoLMS (Learning Management System)
CN102880475A (en)*2012-10-232013-01-16上海普元信息技术股份有限公司Real-time event handling system and method based on cloud computing in computer software system
CN102945264A (en)*2012-10-242013-02-27浪潮集团山东通用软件有限公司Method for intelligently starting distributed transaction

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
蒙祖强: "《T-SQL技术开发实用大全-基于SQL Server 2005/2008》", 31 January 2010*

Cited By (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106354801A (en)*2016-08-262017-01-25广州唯品会信息科技有限公司Distributed database connection method and device
CN106354801B (en)*2016-08-262019-12-20广州品唯软件有限公司Distributed database connection method and device
CN106484882A (en)*2016-10-142017-03-08腾讯科技(深圳)有限公司A kind of management method of database connection pool and device
CN111225007A (en)*2018-11-262020-06-02北京京东尚科信息技术有限公司Database connection method, device and system
CN111225007B (en)*2018-11-262024-01-12北京京东尚科信息技术有限公司Database connection method, device and system
CN110300176A (en)*2019-07-022019-10-01斯德沃(深圳)网络科技有限公司A kind of working method and database RPC service device of database RPC service device
CN114500628A (en)*2021-12-302022-05-13天翼云科技有限公司Connection selection method and device
CN119203217A (en)*2024-09-042024-12-27中国银联股份有限公司 Distributed data node access method, device, equipment, system and medium

Similar Documents

PublicationPublication DateTitle
CN105095438A (en)Data management method and system based on .NET database connection pools
US10534773B2 (en)Intelligent query parameterization of database workloads
CN110309161B (en)Data synchronization method and device and server
KR101925165B1 (en)Enriching database query responses using data from external data sources
US9953639B2 (en)Voice recognition system and construction method thereof
ATE546781T1 (en) CONTROLLING THE ALLOCATION OF RESOURCES FOR BACKUP OPERATIONS
CN103473696A (en)Method and system for collecting, analyzing and distributing internet business information
CN109542605A (en)A kind of container group life cycle management method based on Kubernetes system architecture
JP2005293578A5 (en)
CN114710350A (en)Allocation method and device for callable resources
CN104462158A (en)Data grabbing method and data grabbing system
US7987210B1 (en)System for lightweight objects
CN105446824A (en)Table increment obtaining method and remote data backup method
CN106446301A (en)Customized table scene page generating method and system
CN109739484B (en)Asset relationship model construction system, method and storage medium
CN103078946A (en)Mass real-time data distributing method and mass real-time data access method
CN108243238B (en)Method and device for acquiring performance data
US9032193B2 (en)Portable lightweight LDAP directory server and database
CN107066271A (en)A kind of hierarchy management method and system for showing object
CN108121605B (en)Yann-based cgroup memory control optimization method and system
US7987470B1 (en)Converting heavyweight objects to lightwight objects
Alves et al.Flood: elastic streaming mapreduce
CN114911801A (en)Form processing method and device, processor and electronic equipment
CN111930718A (en)Node adjustment method and device for configuration management database
CN116383208B (en) A method, device, equipment and storage medium for data aggregation at multiple time granularities

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
WD01Invention patent application deemed withdrawn after publication

Application publication date:20151125

WD01Invention patent application deemed withdrawn after publication

[8]ページ先頭

©2009-2025 Movatter.jp