Between start and execute Batch() methods you can execute only inserts and
updates.
SqlMap every statement executes with PreparedStatements.
Use also startTransaction(), commitTransaction(), endTransaction() methods.
Only with this methods batch works normal.
Example:
try {
sqlMap.startTransaction();
sqlMap.startBtach()
all inserts
sqlMap.executeBatch()
sqlMap.startBtach()
all updates
sqlMap.executeBatch()
sqlMap.commitTransaction();
} finally {
sqlMap.endTransaction();
}
Best,
Aram
-----Original Message-----
From: Sumanta Ghosh [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 27, 2006 3:21 PM
To: [email protected]
Subject: IBATIS Batch Support
Does IBATIS have Batch support for preparedstatements e.g. suppose I have got
4 statements, 2 inserts and 2 update. How should I call batch?
Option 1:
sqlMap.startBatch();
all statements
sqlMap.executeBatch()
Option 2:
sqlMap.startBtach()
all inserts
sqlMap.executeBatch()
sqlMap.startBtach()
all updates
sqlMap.executeBatch()
In my idea for option 1 you cannot use preparedstatement, have to use
statements.
Am I Correct? please confirm.
--
View this message in context:
http://www.nabble.com/IBATIS-Batch-Support-tf2008779.html#a5518529
Sent from the iBATIS - User - Java forum at Nabble.com.