I have the following code in a Session Bean:
...
conn = utilObj.getConnection();
System.out.println( "conn obj = " + conn ) ;
System.out.println( "conn closed = " + conn.isClosed() ) ;
SomeClass someObj = new SomeClass(conn, arg2, arg3);
...
SomeClass constructor just has:
public SomeClass(Connection c,
String arg2, String arg3){
System.out.println( "conn obj = " + c ) ;
System.out.println( "conn closed = " + c.isClosed() ) ;
}
Output is as follows:
conn = com.mysql.jdbc.Connection@59f92969
conn closed = false
c = com.mysql.jdbc.Connection@59f92969
conn closed = true
Why did the connection suddenly close when I passed it into a function/constructor?
Environment:
Windows 2000
IBM WSAD 5.1
MySQL 4.0.12
Thanks!