You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Shapira, Yoav" <Yo...@mpi.com> on 2003/11/10 17:28:40 UTC

[DbUtils] Commit flag on QueryRunner

Hi,
I have a request from a coworker who uses DbUtils to add a flag to turn
of auto-commit in the QueryRunner.  The text of his request is below.
What do you think, is it too big to get into DbUtils 1.0?

"There needs to be an option on QueryRunner to turn off the commit()
calls on the updates that use a datasource.  I would like to use it to
build DAOs which will be used in the context of the JTA.  This might be
through either EJB beans or more directly using UserTransaction.  The
presence of the commit calls setAutoCommit, commit, rollback) in the
update methods that use a datasource make this impossible with those
methods.  What I would like to do is instantiate a QueryRunner with a
flag to turn this off."

Yoav Shapira
Millennium ChemInformatics





This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged.  This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [DbUtils] Commit flag on QueryRunner

Posted by David Graham <gr...@yahoo.com>.
--- "Shapira, Yoav" <Yo...@mpi.com> wrote:
> 
> Hi,
> I have a request from a coworker who uses DbUtils to add a flag to turn
> of auto-commit in the QueryRunner.  The text of his request is below.
> What do you think, is it too big to get into DbUtils 1.0?
> 
> "There needs to be an option on QueryRunner to turn off the commit()
> calls on the updates that use a datasource.  I would like to use it to
> build DAOs which will be used in the context of the JTA.  This might be
> through either EJB beans or more directly using UserTransaction.  The
> presence of the commit calls setAutoCommit, commit, rollback) in the
> update methods that use a datasource make this impossible with those
> methods.  What I would like to do is instantiate a QueryRunner with a
> flag to turn this off."

The methods using a DataSource were designed to execute in a single
transaction.  If you disabled the commit and rollback in these methods,
how would you handle the transactions manually without access to the
Connection?

If you want to control Connections with commit and rollback you can just
use the update() methods that take a Connection as the first argument.

David

> 
> Yoav Shapira
> Millennium ChemInformatics
> 
> 
> 
> 
> 
> This e-mail, including any attachments, is a confidential business
> communication, and may contain information that is confidential,
> proprietary and/or privileged.  This e-mail is intended only for the
> individual(s) to whom it is addressed, and may not be saved, copied,
> printed, disclosed or used by anyone else.  If you are not the(an)
> intended recipient, please immediately delete this e-mail from your
> computer system and notify the sender.  Thank you.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org