db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: torque transactions
Date Fri, 10 Jun 2005 13:55:59 GMT




Hi,

In Torque, transactions are handled via the class
org.apache.torque.util.Transaction and java.sql.Connection.

- To start a transaction, call Transaction.begin(String) to get a
connection of the desired database. If you want to use the default
database, call Transaction.begin(Torque.getDefaultDB()). It gives back a
java.sql.Connection object.
- To access the database in the transaction, use the connection object for
every action. There should be a method which takes a Connection for every
method which accesses the database. If you find a place where this is not
the case, complain to the Torque dev list.
-  To commit / rollback a tranaction, use Transaction.commit(Connection)
and tranaction.rollback(Connection). To rollback upon errors, use
Transaction.safeRollback(connection), which does not choke upon null
connection and does not throw any Exceptions.

   Thomas

jmenke@chubb.com schrieb am 10.06.2005 15:01:19:

> What support does torque offer for transactions?
> Does torque have an equivalent of a Hibernate Session or a JDO
> PersistenceManager?
>
> I am trying to integrate Torque with Spring so i need to learn if there
is
> any built in transaction support in Torque and what classes support this.
>
> John Menke
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>


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


Mime
View raw message