ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rafiq, Adnan" <ara...@carreker.com>
Subject Multi-threading and Connections
Date Wed, 24 Aug 2005 15:43:57 GMT
I am in the process of re-writing some batch processes (that run outside of an app server)
and would like to use iBatis as the persistence framework.

My requirements are as follows:

1. the process will spawn multiple threads and each thread needs its own connection. how is
this handled in ibatis? does each thread automatically get its own connection or do I need
to write more code?

2. the process commits/rollbacks at the very end by default however, some batch processes
may do commits in the middle of processing (e.g. in a for-loop) I believe I can just issue
commits using the iBatis API. is this correct?

3. I plan to use a Simple JDBC datasource as TX manager. Is this the best approach or are
there better alternatives out there?

Any help in this matter is greatly appreciated.

-----Original Message-----
From: Graeme J Sweeney [mailto:ibatis.user@gjsweeney.com]
Sent: Wednesday, August 24, 2005 10:23 AM
To: iBatis List
Subject: [REPOST] sqlMap + multiple deletes: getting the total number of
rows deleted

[Looks like my first post got lost when the list went down :-/]


I'm a newbie to iBatis and as part of some unit-testing I need to confirm 
that the correct number of rows are deleted when removing some records.

If do

<delete id="deleteXY">
delete from X where id=#value#;
delete from Y where id=#value#;

I get the number of rows deleted from Y only.

If I split the delete into two separate entries:

<delete id="deleteX">
delete from X where id=#value#;

<delete id="deleteY">
delete from Y where id=#value#;

and call them both, I get the expected number of rows deleted when I add them.

Is there a way to have only one call to <delete/> and get the total 
number of rows deleted ?


Graeme -

View raw message