Hi Alexandru, you should not close the connection directly since it is maintained by the connection pool. And you might use Transaction.safeRollback() since it doesn't throw any further exceptions. And you should configure the connection pool properly to check a connection before it is going to be used ...
Don't know about the JNDI stuff ... :-) Cheers, Siegfried Goeschl -----Original Message----- From: Alexandru Dovlecel [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 22. April 2004 12:28 To: 'Apache Torque Users List' Subject: 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
