Skip to content

JtdsStatement finalizer waits for query to finish #21

Description

@TaylanUB

I'm using jTDS in an Android application and if I interrupt a background thread running a query, it crashes my app with the following trace:

java.util.concurrent.TimeoutException: net.sourceforge.jtds.jdbc.JtdsStatement.finalize() timed out after 10 seconds
    at net.sourceforge.jtds.jdbc.JtdsConnection.releaseTds(JtdsConnection.java)
    at net.sourceforge.jtds.jdbc.JtdsStatement.close(JtdsStatement.java:972)
    at net.sourceforge.jtds.jdbc.JtdsStatement.finalize(JtdsStatement.java:219)
    at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:222)
    at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:209)
    at java.lang.Thread.run(Thread.java:761)

The releaseTds method is synchronized which makes me think this might be related to a deadlock. Or it might be waiting for some other long-running query to end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions