iBATIS querying pattern for web applications

2008-05-27 Thread Filipe David Manana
Hello, I am developing a webapp and using iBATIS for the first time. I configured iBATIS to use a JDBC transaction manager and a JNDI datasource, provided by Tomcat+DBCP. When my webapp is deployed, a Servlet executes and initializes iBATIS : SqlMapClient sqlMap = null; Reader reader

Re: iBATIS querying pattern for web applications

2008-05-27 Thread Nicholoz Koka Kiknadze
Can your query raise exception that's handled elsewhere, so that session.close() is not called? Try this: SqlMapSession session = sqlMap.openSession(); List list = null; try { list = (List) session.queryForList(queryId); } catch (Exception e) {

Re: iBATIS querying pattern for web applications

2008-05-27 Thread Filipe David Manana
Not really. I was catching exceptions, just omitted them in the email for the sake of shortness :). So, the possibility of leaving sessions open is strange, as there are no more than 1 request at a time, as the queries are very simple and with small result sets, so the life period of sessions

Re: iBATIS querying pattern for web applications

2008-05-27 Thread Nicholoz Koka Kiknadze
Can you look from another side, i.e. check database sessions when the the exception occurs. I'd look at last sql executed in those sessions to find if there's same sql that's stuck or long running. It could tell you which part of your code to check... Last time I've seen that exception it was