Changes between Version 1 and Version 2 of DatabaseConnectionsForThreadsAndNewPool
- Timestamp:
- 01/31/11 23:14:13 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DatabaseConnectionsForThreadsAndNewPool
v1 v2 10 10 == Overview == 11 11 12 Database connections (jeeves/src/main/java/jeeves/resources/dbms/Dbms.java) in Jeeves are handled by a ResourceManager (jeeves/src/main/java/jeeves/server/resources/ResourceManager.java) and pooled by aResourceProvider (jeeves/src/main/java/jeeves/resources/dbms/DbmsPool.java).12 Database connections (jeeves/src/main/java/jeeves/resources/dbms/Dbms.java) in Jeeves are handled by a !ResourceManager (jeeves/src/main/java/jeeves/server/resources/ResourceManager.java) and pooled by a !ResourceProvider (jeeves/src/main/java/jeeves/resources/dbms/DbmsPool.java). 13 13 14 14 A jeeves service that needs a database connection will typically open one using a call like: … … 16 16 Dbms dbms = (Dbms) context.getResourceManager().open(Geonet.Res.MAIN_DB); 17 17 18 This can be done any number of times by methods called by the service. As each Dbms object is opened the ResourceManager keeps a reference to it in an internal hashtable.18 This can be done any number of times by methods called by the service. As each Dbms object is opened the !ResourceManager keeps a reference to it in an internal hashtable. 19 19 20 20 If the service completes without exception, all database connections are closed by Jeeves using context.getResourceManager().close() or if there is an exception raised context.getResourceManager().abort() … … 22 22 However there is a need for threads that want a database connection to obtain a connection and hold that connection open even though the service that started the thread may have closed. 23 23 24 This proposal will add the following calls to the ResourceManager to support threads that need a database connection in GeoNetwork/Jeeves:24 This proposal will add the following calls to the !ResourceManager to support threads that need a database connection in GeoNetwork/Jeeves: 25 25 26 26 * openDirect(): essentially does the same as open but does not keep a reference to the Dbms resource in the ResourceManager hashtable