-
1. Re: [sqlServerPool] No transaction right now.
davidjencks Aug 23, 2001 9:10 AM (in response to doritc)Perhaps you are holding onto the connection between transactions? This currently does not work in jboss, and is usually a bad idea as it attempts to defeat connection pooling.
You can hold onto the datasource. Assuming you have, try this:
(in method)
Connection conn = ds.getConnection();
try {
PreparedStatement ps = ...
...
ps.close()
}
finally {
conn.close();
}
This _is_ proper use of pooled connections. The connection you get is a handle to a real db connection, and calling close on it merely signals to jboss that you are done doing work on it and the transaction can end, and the connection can be reused. -
2. Re: [sqlServerPool] No transaction right now.
d4ljoyn Aug 26, 2001 6:48 AM (in response to doritc)I'm getting the same error, using CMP (meaning you haven't done anything wrong in your code as far as handling the connection).
Looking at SQL Profiler I see that every transaction is being rolled back with this statement
if (@@trancount > 0) rollback tran
I've tried three different JDBC drivers -- jnet direct, weblogic, merant.
It seems to me this is an issue with jBoss and SQL Server. Are you using SQL Server 2000? Anybody got any ideas?
Thanks
Dave Joyner