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 byte[

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 into images (ImageID,ima

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 shoul

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 atte

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 pure

Re: Mapping HSQLDB's binary using iBatis

2008-05-27 Thread Jonathan Alvarsson
On Tue, May 27, 2008 at 5:11 PM, Jeff Butler <[EMAIL PROTECTED]> wrote: > 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 > LOL, paramater mappings? :) I wrote my firs

Re: Mapping HSQLDB's binary using iBatis

2008-05-27 Thread Jeff Butler
Inline parameter mappings only - and only for NULL capable fields! I detest the XML parameter maps! :) Jeff Butler On Tue, May 27, 2008 at 11:04 AM, Jonathan Alvarsson < [EMAIL PROTECTED]> wrote: > On Tue, May 27, 2008 at 5:11 PM, Jeff Butler <[EMAIL PROTECTED]> > wrote: > >> I have tests work

Re: Mapping HSQLDB's binary using iBatis

2008-05-27 Thread Jonathan Alvarsson
On Tue, May 27, 2008 at 6:32 PM, Jeff Butler <[EMAIL PROTECTED]> wrote: > Inline parameter mappings only - and only for NULL capable fields! I > detest the XML parameter maps! :) > huh which syntax would that be? I am not great at the lingo I feel... :) -- // Jonathan

Re: Mapping HSQLDB's binary using iBatis

2008-05-27 Thread Jeff Butler
This is an inline parameter mapping: insert into foo (binaryField) values(#binaryField:BINARY#) Setting the JDBC type to BINARY here will help if you ever need to set the field to NULL. If it won't ever be NULL, then you don't need the JDBC type (but it doesn't hurt to add it anyway). Jeff

flushOnExecute values

2008-05-27 Thread Andrey Rogov
my stored procedure changes information in a database. Can I specify stored procedure name as a value for flushOnExecute statement ? Andrey

echo dynamic sql

2008-05-27 Thread Prateek Asthana
Hi, When using dynamic sql generation using the various tags, is it possible to echo the final SQL query that will be executed against the database. I understand the query will change depending upon the various conditions and want to see what is the final SQL query which is getting executed. Thank

Re: flushOnExecute values

2008-05-27 Thread Larry Meadors
Yes - you are specifying a mapped statement name, so anything that is a mapped statement can go there. Larry On Tue, May 27, 2008 at 3:30 PM, Andrey Rogov <[EMAIL PROTECTED]> wrote: > my stored procedure changes information in a database. > Can I specify stored procedure name as a value for flus