Subject Re: [IB-Java] Type 4 driver - long pause during releaseDbHandle
Author Kenneth Foo
Did a trace through the code, and found that the code hung during the
following stack trace

FBManagedConnection.notify
FBStandAloneConnectionmanager.connectionClosed
FBManagedConnection.destroy
FBManagedConnectionFactory.releaseDbHandle
GDS_Impl.isc_detach_database
GDS_Impl.receiveResponse
GDS_Impl.readOperation
GDS_Impl.nextOperation (long pause here during db.in.readInt() )

Anybody found a solution to this?

Thanks!

Regards
Kenneth


----- Original Message -----
From: "Kenneth Foo" <kenneth@...>
To: <ib-java@yahoogroups.com>
Sent: Thursday, January 24, 2002 8:29 AM
Subject: [IB-Java] Type 4 driver - closing connection takes eternity


> Hi, I'm having a problem using the Type 4 driver whereby the
> opened connection takes a long time to close, especially after performing
> a batch insert operation. (Source code below)
>
> It took me only roughly 1 second to perform 100 inserts,
> but 75 seconds to close the connection after that (?).
>
> I tried inserting 1000 items, and my patience ran out before the
connection
> actually closed. (I've waited close to 5 to 10 minutes, and it still
hasn't
> closed).
>
> Processor usage is 0% during the wait.
>
> I usually end up terminating my app. Next time I tried to run the app
again,
> Interbase deadlocked. Sigh.
>
> Any solutions? (or at least know a workaround)
>
> Thanks!
>
> Kenneth
>
> [CODE BELOW]
>
>
> import java.sql.*;
> import org.firebirdsql.jdbc.*;
>
> public class TestFB {
>
> public TestFB() {
> }
>
> public static void main (String args[]) {
>
> try {
> Class.forName("org.firebirdsql.jdbc.FBDriver");
> Connection con =
> DriverManager.getConnection("jdbc:firebirdsql:localhost:x:/db/ncsdb.gdb",
> "SYSDBA", "masterkey");
> con.setAutoCommit(true);
> Statement statement = con.createStatement();
> statement.executeUpdate("DELETE FROM MESSAGES WHERE ID>=1000
AND
> FOLDER_ID=999;");
>
> PreparedStatement ps = con.prepareStatement("INSERT INTO
> MESSAGES (ID,FOLDER_ID) VALUES(?,?);");
> con.setAutoCommit(true);
>
> long l1 = System.currentTimeMillis();
> for (int v = 0; v<1000; v++) {
> ps.clearParameters();
> ps.setLong(1, 1000+v);
> ps.setLong(2, 999);
> ps.executeUpdate();
> }
>
> System.out.println("FINISHED INSERT...");
>
> ps.close();
>
> long l2 = System.currentTimeMillis();
> System.out.println(l2-l1);
>
> System.out.println("CLOSING CONNECTION...");
>
> con.close();
>
> long l3 = System.currentTimeMillis();
> System.out.println(l3-l2);
>
> System.out.println("DONE!");
> }
> catch (Exception ex) {
> ex.printStackTrace();
> }
>
> }
>
> }
>
>
>
>
> To unsubscribe from this group, send an email to:
> IB-Java-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>