Clinton,
Thanks for the coding tips. Those are good suggestions.
We are using the SIMPLE data source, but as it turns out, the problem is probably not a stale connection. That application uses apache for authentication. Our WebSphere Admin tried logging on this morning with a bogus user ID, and that page took as long to come back as with a valid user Id. In other words, the slow response we are having in the mornings happens during authentication on Apache, not within the iBatis application on WebSphere.
Thanks again, Steve
-----Original Message-----
Question:
which DataSource (i.e. connection pool) are you using? On 9/30/05, Mitchell, Steven C <[EMAIL PROTECTED]> wrote: I've used iBatis on many projects now. My latest project has run out of Oracle connections a couple of time during testing, which has me concerned. There did not appear to be any kind of looping going on. I found only one Controller method that called multiple methods that used the same DAO. I changed the parent method to get the DAO and pass it into the two child methods.
Now, I'm wondering if I am using Transactions as they were indented. I've only used Transaction on updates. Should I use them on reads to make sure everything gets cleaned up. Here is an example of what I do:
// NO TRANSACTION FOR QUERIES
public static Company getCompany( Integer companyId ) throws IVRPasswordException { try { final DaoManager daoManager = DaoHelper.getDaoManager(); final CompanyDao companyDao = ( CompanyDao ) daoManager.getDao( CompanyDao.class ); return companyDao.getCompany( companyId ); } catch ( Exception e ) { throw new IVRPasswordException( e ); } }
// TRANSACTION FOR ALL UPDATES/INSERTS/DELTES
public static void updateCompany( Company company ) throws IVRPasswordException { DaoManager daoManager = null; try { daoManager = DaoHelper.getDaoManager(); daoManager.startTransaction(); final CompanyDao companyDao = (CompanyDao) daoManager.getDao( CompanyDao.class ); companyDao.updateCompany( company ); daoManager.commitTransaction(); } catch ( Exception e ) { throw new IVRPasswordException( e ); } finally { if ( daoManager != null ) { daoManager.endTransaction(); } } }
Thoughts?
Steve
Mitchell
|
- RE: Transaction Best Practices Mitchell, Steven C
- RE: Transaction Best Practices Mitchell, Steven C
- Re: Transaction Best Practices Clinton Begin