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: Mapping HSQLDB's binary using iBatis

2008-05-27 Thread Jonathan Alvarsson
Okey this was a really long time ago but attempt to circumvent this is not working. I really need the BINARY data type in the database because I need to perform bitwise and during a query (btw: would you do that in a stored procedure?). I am using HSQLDB for the moment and I see that they use

Re: Mapping HSQLDB's binary using iBatis

2008-05-27 Thread Nicholoz Koka Kiknadze
I'm inserting images into MS Sql (table field type is image i.e. variable-length binary data) without problems with no special configuration. I have an Image class with two properties String imageID byte[] imageBytes and the insert looks like insert id='insertImage'

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: Mapping HSQLDB's binary using iBatis

2008-05-27 Thread Jeff Butler
I have tests working fine with the HSQLDB binary type: 1. Use a byte[] for the property. 2. Set jdbcType to BINARY in your parameter and result mappings Jeff Butler On Tue, May 27, 2008 at 9:32 AM, Jonathan Alvarsson [EMAIL PROTECTED] wrote: Okey this was a really long time ago but attempt

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