|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DbPool
A pool of logical Db connections.
The DbPool manages a pool of Db instances.
From an application's point of view, a DbPool resembles to what
is known as a "connection pool" in traditional (mostly J2EE) server-based applications.
However, because a Db does not necessarily correspond to a physical connection
(this is up to a ConnectionManager), a DbPool is one abstraction level
above a typical connection pool.
In fact, Tentackle servers use a DbPool, but only to optimize caching.
The Db instances will run on an MpxConnectionManager,
which actually does the multiplexing of physical connections.
So don't mix up a DbPool with a multiplexing connection manager!
Of course, you can use a DbPool with a non-multiplexing connection manager.
This can make sense in pure web-applications providing their own session management
(JSP, for example). For fat-client application servers, however, this is
not a good idea, because the client is associated with a Db (in fact two Dbs)
for as long as it is logged in and not just for the duration of a rather
short-timed http-request/response roundtrip.
| Method Summary | |
|---|---|
Db |
getDb()
Gets a Db instance from the pool. |
int |
getMaxSize()
Gets the maximum poolsize. |
int |
getSize()
Gets the current number of Db instances. |
void |
putDb(Db db)
Returns a Db instance to the pool. |
void |
shutdown()
Closes all databases in the pool, cleans up and makes the pool unusable. |
| Method Detail |
|---|
int getMaxSize()
int getSize()
Db getDb()
throws DbRuntimeException
DbRuntimeException - if pool is exhausted
void putDb(Db db)
throws DbRuntimeException
Notice: returning a Db to the pool more than once is allowed.
db - the Db instance
DbRuntimeException - if the Db cannot be returnedvoid shutdown()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||