Subject | Re: [Firebird-Java] Re: Failure to delist resource |
---|---|
Author | David Jencks |
Post date | 2004-08-24T22:56:57Z |
The problem could be in either jboss or jaybird.
Assuming you are executing the code shown below inside a JTA
transaction (such as in a "Required" method), JBoss will make sure that
both connection handles (connection and connection2) are associated
with the same ManagedConnection. It's possible that the connection
handle accounting in JBoss is broken and that JBoss thinks there is
still an open handle even after you have closed both, and that JBoss is
still tracking the managed connection in some way. The 25 minute delay
is suspicious here since this should give jboss time to close the
managed connection as being idle too long.
It is also possible that there is a problem in jaybird, but I don't
have any ideas at the moment as to what it might be.
Your code should work the same way if you use only one connection, or
close the first connection before opening the second. This ought to
sidestep this problem completely. If the bug is in JBoss this may be
the most expeditious solution.
thanks
david jencks
Assuming you are executing the code shown below inside a JTA
transaction (such as in a "Required" method), JBoss will make sure that
both connection handles (connection and connection2) are associated
with the same ManagedConnection. It's possible that the connection
handle accounting in JBoss is broken and that JBoss thinks there is
still an open handle even after you have closed both, and that JBoss is
still tracking the managed connection in some way. The 25 minute delay
is suspicious here since this should give jboss time to close the
managed connection as being idle too long.
It is also possible that there is a problem in jaybird, but I don't
have any ideas at the moment as to what it might be.
Your code should work the same way if you use only one connection, or
close the first connection before opening the second. This ought to
sidestep this problem completely. If the bug is in JBoss this may be
the most expeditious solution.
thanks
david jencks
On Aug 24, 2004, at 6:19 AM, Dmitry Shohov wrote:
> I found how to reproduce this bug (or whatever it is).
> 1. Get the connection to the database,
> 2. do some selects (don't know if it is needed)
> 3. then get another connection to the same database while first
> connection is still open
> 4. do some selects with second connection
> 5. close second connection
> 6. close first connection.
> 7. wait 25 min. and try to get connection
> 8. you'll get an exception in Datasource.getConnection()
>
> I have all the sources needed and small jar file with bean and
> scheduler. If someone (Roman) needs it I can send it.
>
> DS> Hi!
>
> DS> We are using JayBird JCA driver with JBoss and have a problem.
> DS> We have some code that performs some actions on database (inserts
> DS> updates, deletes, selects). Once this code executed after about 20
> DS> minutes we are starting to get exceptions. Any suggestions?
>
> DS> Vesions: Jaybird 1.5 RC4, Firebird 1.5.1, Jboss 3.2.5
>
> --
> Dmitry
>
> Connection connection = getConnection();
> try {
> PreparedStatement preparedStatement =
> connection.prepareStatement("SELECT testcol FROM testtable");
> try {
> ResultSet resultSet = preparedStatement.executeQuery();
> try {
> while (resultSet.next()) {
> String testColValue = resultSet.getString(1);
> System.out.println(testColValue);
> }
> } finally {
> resultSet.close();
> }
> } finally {
> preparedStatement.close();
> }
> Connection connection2 = getConnection();
> try {
> PreparedStatement preparedStatement2 =
> connection2.prepareStatement("SELECT testcol FROM testtable");
> try {
> ResultSet resultSet = preparedStatement2.executeQuery();
> try {
> while (resultSet.next()) {
> String testColValue = resultSet.getString(1);
> System.out.println(testColValue);
> }
> } finally {
> resultSet.close();
> }
> } finally {
> preparedStatement2.close();
> }
> } finally {
> connection2.close();
> }
> } finally {
> connection.close();
> }
>
>
>
>
>
>
> Yahoo! Groups Sponsor
>
> ADVERTISEMENT
> <81804_0704_b_300250a.gif>
> <l.gif>
>
> Yahoo! Groups Links
>
> • To visit your group on the web, go to:
> http://groups.yahoo.com/group/Firebird-Java/
>
> • To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
> • Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.
>
>