cancel
Showing results for 
Search instead for 
Did you mean: 

understanding StatementSapDB.finalize to avoid BLOCKED threads.

Former Member
0 Kudos

Hi,

again, my system get BLOCKED, and i'm try to figure why, i hope that someone can help me to understanding the use of StatementSapDB.finalize, first the facts:

1) Blocked thread

"Finalizer" daemon prio=10 tid=0x00000000481a7800 nid=0x1a12 waiting for monitor entry [0x0000000040dbb000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at com.sap.dbtech.jdbc.StatementSapDB.finalize(StatementSapDB.java:450)
        - waiting to lock <0x00002aaacb9253c8> (a com.sap.dbtech.jdbc.ConnectionSapDB)
        at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
        at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
        at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)

2) Thread that blocks Finalizer

"Thread-9891" daemon prio=10 tid=0x00002aab24b4b800 nid=0x35e0 runnable [0x0000000044a23000]
   java.lang.Thread.State: RUNNABLE
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at com.sap.dbtech.rte.comm.BasicSocketComm.receiveData(BasicSocketComm.java:745)
        at com.sap.dbtech.rte.comm.BasicSocketComm.receive(BasicSocketComm.java:837)
        at com.sap.dbtech.rte.comm.JdbcCommunication.execute(JdbcCommunication.java:41)
        at com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:632)
        - locked <0x00002aaacb9253c8> (a com.sap.dbtech.jdbc.ConnectionSapDB)
        at com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:563)
        at com.sap.dbtech.jdbc.CallableStatementSapDB.execute(CallableStatementSapDB.java:440)
        at com.sap.dbtech.jdbc.CallableStatementSapDB.execute(CallableStatementSapDB.java:312)
        at com.sap.dbtech.jdbc.CallableStatementSapDB.executeQuery(CallableStatementSapDB.java:730)
        at com.sap.dbtech.jdbc.trace.PreparedStatement.executeQuery(PreparedStatement.java:178)
        at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
        at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
        at com.supridatta.xml.ReportGenerator.executeParse(ReportGenerator.java:583)

3) at database side i have:

T101   7     -1 User      6668* TableRootShare        0 0         19617 14906136(s)
T108   7     -1 User      6668* TableRootShare        0 0         19617 14906136(s)
T109   7     -1 User      6668* TableRootExcl         0 0         19617 14906136(s)
T111   7     -1 User      6668* TableRootShare        0 0         19617 14906136(s)
...and much more like that...

Note that thread 1 get block because of waiting to lock <0x00002aaacb9253c8> (a com.sap.dbtech.jdbc.ConnectionSapDB) that is locked by Thread-9891, as this is a report in my system, the Finalizer cant finalize the statement until the report ends.

I think that because finalize dont occurs, i get the TableRootShare, and maybe the report need some data that must wait finalize occurs, then here we got a deadlock.

My doubt is, as i realease all resources, and connections get pooled by Tomcat DBM, maybe exists something specific in MaxDB JDBC driver that i must release, that i dont release today?

note, i think that statement at Finalizer was created by another Thread that was reach the end, then same connection get by a new thread from pool, and used, then Finalizer acts, and block all things.

i'm investigating the hprof file with MemoryAnalyzerTool MAT, i will try to find more info, but any insight about this problem, maybe help me to find the root of problem.

best regards.

Clóvis

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

This problem occured again today, anyone have any idea?