开发者

My Java program freezes on call to oracle.jdbc.pool.OracleOCIConnectionPool.getConnection for a couple of minutes

开发者 https://www.devze.com 2023-02-04 15:57 出处:网络
I have a Java app which connects to oracle 11g. The process freezes for 2 to 3 minutes at the oracle.jdbc.pool.OracleOCIConnectionPool.getConnection method. It does manage to get the connection and co

I have a Java app which connects to oracle 11g. The process freezes for 2 to 3 minutes at the oracle.jdbc.pool.OracleOCIConnectionPool.getConnection method. It does manage to get the connection and continues without any error after the 3 minutes time though.

The weird bit of this is that the same program runs fine from a different machine when connecting to the same database.

I can't figure out what is going on here. Can any one help me out with this?

Below is the thread dump of the a sample program when it is stuck at the getConnection method:

Full thread dump Java HotSpot(TM) Server VM (1.5.0_11-b03 mixed mode):

"Thread-9" prio=10 tid=0x00431a60 nid=0x24 runnable [0xaffff000..0xaffffb70]
        at java.lang.Thread.yield(Native Method)
        at conPoolAppl.run(conPoolAppl.java:101)

"Thread-8" prio=10 tid=0x00430e50 nid=0x23 runnable [0xb00ff000..0xb00ff9f0]
        at java.lang.Thread.yield(Native Method)
        at conPoolAppl.run(conPoolAppl.java:101)

"Thread-7" prio=10 tid=0x00460490 nid=0x22 runnable [0xb01ff000..0xb01ffa70]
        at java.lang.Thread.yield(Native Method)
        at conPoolAppl.run(conPoolAppl.java:101)

"Thread-6" prio=10 tid=0x00249320 nid=0x21 runnable [0xb02ff000..0xb02ff8f0]
        at java.lang.Thread.yield(Native Method)
        at conPoolAppl.run(conPoolAppl.java:101)

"Thread-5" prio=10 开发者_如何学编程tid=0x000b7910 nid=0x20 runnable [0xb03ff000..0xb03ff970]
        at java.lang.Thread.yield(Native Method)
        at conPoolAppl.run(conPoolAppl.java:101)

"Thread-4" prio=10 tid=0x000b7128 nid=0x1f runnable [0xb04ff000..0xb04ffbf0]
        at java.lang.Thread.yield(Native Method)
        at conPoolAppl.run(conPoolAppl.java:101)

"Thread-3" prio=10 tid=0x00126a50 nid=0x1e runnable [0xb05ff000..0xb05ffc70]
        at java.lang.Thread.yield(Native Method)
        at conPoolAppl.run(conPoolAppl.java:101)

"Thread-2" prio=10 tid=0x0058bc38 nid=0x1d runnable [0xb06ff000..0xb06ffaf0]
        at java.lang.Thread.yield(Native Method)
        at conPoolAppl.run(conPoolAppl.java:101)

"Thread-1" prio=10 tid=0x00125d90 nid=0x1c runnable [0xb07ff000..0xb07ffb70]
        at java.lang.Thread.yield(Native Method)
        at conPoolAppl.run(conPoolAppl.java:101)

"Low Memory Detector" daemon prio=10 tid=0x001c5f50 nid=0x19 runnable [0x00000000..0x00000000]

"CompilerThread1" daemon prio=10 tid=0x001c4de8 nid=0x18 waiting on condition [0x00000000..0xb347e8b4]

"CompilerThread0" daemon prio=10 tid=0x001c3f70 nid=0x17 waiting on condition [0x00000000..0xb357e93c]

"AdapterThread" daemon prio=10 tid=0x001c30f8 nid=0x16 waiting on condition [0x00000000..0x00000000]

"Signal Dispatcher" daemon prio=10 tid=0x001c2388 nid=0x15 waiting on condition [0x00000000..0x00000000]

"Finalizer" daemon prio=10 tid=0x001b5b80 nid=0x14 in Object.wait() [0xb387f000..0xb387faf0]
        at java.lang.Object.wait(Native Method)
        - waiting on <0xe30006d8> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
        - locked <0xe30006d8> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=10 tid=0x001b4e38 nid=0x13 in Object.wait() [0xb397f000..0xb397fb70]
        at java.lang.Object.wait(Native Method)
        - waiting on <0xe30005e8> (a java.lang.ref.Reference$Lock)
        at java.lang.Object.wait(Object.java:474)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
        - locked <0xe30005e8> (a java.lang.ref.Reference$Lock)

"main" prio=10 tid=0x00036898 nid=0x1 runnable [0xffbfc000..0xffbfcf30]
        at oracle.jdbc.driver.T2CConnection.t2cConnPoolLogon(Native Method)
        at oracle.jdbc.driver.T2CConnection.processOCIConnectionPooling(T2CConnection.java:1103)
        at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:258)
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
        at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:148)
        at oracle.jdbc.driver.OracleOCIConnection.<init>(OracleOCIConnection.java:60)
        at oracle.jdbc.driver.OracleOCIConnection.<init>(OracleOCIConnection.java:44)
        at oracle.jdbc.oci.OracleOCIConnection.<init>(OracleOCIConnection.java:35)
        at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:49)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
        at oracle.jdbc.pool.OracleOCIConnectionPool.getConnection(OracleOCIConnectionPool.java:244)
        - locked <0xe3272a78> (a oracle.jdbc.pool.OracleOCIConnectionPool)
        at conPoolAppl.main(conPoolAppl.java:47)

"VM Thread" prio=10 tid=0x001b2d58 nid=0x12 runnable

"GC task thread#0 (ParallelGC)" prio=10 tid=0x000b8148 nid=0x2 runnable

"GC task thread#1 (ParallelGC)" prio=10 tid=0x000b8b88 nid=0x3 runnable

"GC task thread#2 (ParallelGC)" prio=10 tid=0x000b95c8 nid=0x4 runnable

"GC task thread#3 (ParallelGC)" prio=10 tid=0x000ba008 nid=0x5 runnable

"GC task thread#4 (ParallelGC)" prio=10 tid=0x000baa48 nid=0x6 runnable

"GC task thread#5 (ParallelGC)" prio=10 tid=0x000bb488 nid=0x7 runnable

"GC task thread#6 (ParallelGC)" prio=10 tid=0x000bbee0 nid=0x8 runnable

"GC task thread#7 (ParallelGC)" prio=10 tid=0x000bd128 nid=0x9 runnable

"GC task thread#8 (ParallelGC)" prio=10 tid=0x000bdb68 nid=0xa runnable

"GC task thread#9 (ParallelGC)" prio=10 tid=0x000be5a8 nid=0xb runnable

"GC task thread#10 (ParallelGC)" prio=10 tid=0x000befe8 nid=0xc runnable

"GC task thread#11 (ParallelGC)" prio=10 tid=0x000bfa28 nid=0xd runnable

"GC task thread#12 (ParallelGC)" prio=10 tid=0x000c0468 nid=0xe runnable

"GC task thread#13 (ParallelGC)" prio=10 tid=0x000c0ea8 nid=0xf runnable

"GC task thread#14 (ParallelGC)" prio=10 tid=0x000c18e8 nid=0x10 runnable

"GC task thread#15 (ParallelGC)" prio=10 tid=0x000c2328 nid=0x11 runnable

"VM Periodic Task Thread" prio=10 tid=0x001c71e0 nid=0x1a waiting on condition


Use ltrace&strace (linux) or truss&dtrace (solaris) to see what the native code is doing.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号