You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Alexandru Dovlecel <al...@siemens.com> on 2004/04/22 12:27:47 UTC

Release a connection

Hi all,

I am using a connection pool defined by torque in the runtime config file
(see end of message). I want to implement a transaction using the objects
generated by torque. So I create a
java.sql.Connection con = Transaction.begin( "transporter" ) ;

After executing the methods I call the Transaction.rollBack or
Transaction.commit( con ) method.

QUESTION: DO I HAVE TO CLOSE THE CONNECTION??? Like con.close() ???

What if I'm going to use a DataSet exposed with the JNDI and referenced by
torque? Do I have to close the connection?

The code generated by torque does not close the connection. Is it correct?

Pls answer ASAP. Thanks,
Alex

Here is the config file:


torque.database.transporter.adapter=mssql
torque.database.transporter.driver=com.microsoft.jdbc.sqlserver.SQLServerDri
ver
torque.database.transporter.url=jdbc:microsoft:sqlserver://localhost:1433;Da
tabaseName=mydb
torque.database.transporter.username=myuser
torque.database.transporter.password=mypwd

torque.dsfactory.transporter.factory=org.apache.torque.dsfactory.SharedPoolD
ataSourceFactory
torque.dsfactory.transporter.connection.driver=com.microsoft.jdbc.sqlserver.
SQLServerDriver
torque.dsfactory.transporter.connection.url=jdbc:microsoft:sqlserver://local
host:1433;DatabaseName=mydb
torque.dsfactory.transporter.connection.user=myuser
torque.dsfactory.transporter.connection.password=mypwd


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