Earlier i was using jvm parameters for data base connection URL, user, password. But now, i started using jboss datasource defined in jboss/default/deploy as an xml qds.xml
I am using c3po for connection pooling. When i run my application , i get following exception : java.sql.SQLException: Already closed at org.jboss.resource.adapter.jdbc.WrappedStatement.close(WrappedStatement.java:69)
This error is generally thrown in finally block where i am closing pstmt.close();
Interestingly, pstmt.closed is false before committing the transaction but when it invokes pstmt.close(), it finds pstmt already closed( closed=true) and throws the above execption.
It used to work fine till we started using jboss data source.
If the Connection has already been closed, then that closure would also have closed the Statement.
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Patricia Samuel
Ranch Hand
Joined: Sep 12, 2007
Posts: 300
posted
0
No, connection has not been already closed. problem is with pstmt.close() which says close() won't throw an exception if it is already closed. but it does ...
i am using jboss -4.0.4GA , i read some where if i enable aop (Aspector) it can solve my problem
but i dont know how to implement this.
Please suggest me solution for this problem
Thanks
Pedro Gontijo
Greenhorn
Joined: Sep 10, 2008
Posts: 1
posted
0
Hi Patricia,
Did you find out what was the problem? I am having the same problem here...
I love problems like these because the exception in this case is extremely helpful. If you're getting a message that a statement is closed, then it is closed. You're task is to figure out why.
Try posting your entire JDBC code snippet (minus the queries) and/or consider in what cases other processes might be closing your objects. 9 times out of 10, connection closed can be traced to a coding error.
Ack, just realized this thread is probably dead since Patricia posted it 9 months ago... For Pedro: my comments still apply. [ September 10, 2008: Message edited by: Scott Selikoff ]
Can you tell me the exact scenario? Are you getting this error from the initial stage or you've started to get this error when you switched to use JNDI.And kindly paste the code for better clarity.
Thanks
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.