how to deal with connection pooling

7 views
Skip to first unread message

ashishwave

unread,
Sep 14, 2008, 2:42:23 AM9/14/08
to Persist
say, i have a web application running on jboss. now if i use "persist"
then it will stuck with the connection, it got at its initialisation
time. it is not going to fetch it from pool (available in jboss , say)
and return the connection to it.

and say, even if i initialise and close persist, everytime, in my
every method and return the db connection to the pool mysqlf then it
will mean that every time persist will initialise and read the class ,
it will not use cache of mapping the attributes etc to the db
column

Dave Rafkind

unread,
Sep 14, 2008, 8:17:11 AM9/14/08
to per...@googlegroups.com
You could make a seperate cache of persist objects :)

Julio Maia

unread,
Sep 14, 2008, 9:49:00 AM9/14/08
to per...@googlegroups.com
There's no need at all to maintain a cache for persist. Just get a
connection from the connection pool, instantiate persist with it then
release the connection using one of the helper methods. Persist does proper
caching for the mappings across multiple instances, you can instantiate it
and release connections multiple times safely and it will maintain performance and
consistency.
Reply all
Reply to author
Forward
0 new messages