-
1. Re: Does JBoss cache PreparedStatements?
davidjencks Sep 9, 2001 1:50 AM (in response to toddh)jboss has cached prepared statements since at least feb 2001. There has been some discussion, however, that this may not be always appropriate since a well designed db driver could cache prepared statements in a more appropriate way for the particular database, and 2 caches might possibly interfere with each other.
-
2. Re: Does JBoss cache PreparedStatements?
lolsson Sep 9, 2001 8:37 AM (in response to toddh)How does one code stateless session beans to benefit
from this caching?
Can I write my business methods so that they release
connections and statements as soon as they are
done with them? Something like this:public void BM(...) throws .....{ Connection c = mydatasource.getConnection(); PreparedStatement s = c.prepare("select ..."); .... ... use <s> .... .... s.close(); c.close(); }
-
3. Re: Does JBoss cache PreparedStatements?
davidjencks Sep 11, 2001 5:32 PM (in response to toddh)well, close the result set(if any) too. In fact, you _must_ close connections before the transaction commits in jboss, and get new ones after the start of the next transaction, in order to assure enrollment in the correct transaction.