If you're in the same transaction, and all of your DAOs are using the same database, there's no need to start more than one batch (and in fact it could be causing significant problems for you).

The batch control DAO is just a convenient, reusable DAO that provides access to the batch API from the SQL Mapping framework, or your own custom JDBC batching code.

Clinton

On 8/13/05, Hycel Taylor <[EMAIL PROTECTED]> wrote:
Interesting.  I'm not sure what, batchControlDao, is doing here.
Currently, what I've just learned from others on this forum and what
I'm currently doing is the following:

daoManager.startTransaction();

schoolDao.startBatch();
majorDao.startBatch();
courseDao.startBatch();
...

// do work here.

schoolDao.executeBatch();
majorDao.executeBatch();
courseDao.executeBatch();
...

daoManager.commitTransaction ();
daoManager.endTransaction();

This seems to be working.  Although, when I am batching this way, an
awful lot of locks are made on the database.  This wasn't happening
when I was doing strait JDBC.  So, I'm not sure if I'm using your DAO
API with batching properly.

What do you suggest?

Reply via email to