Discussions
Categories
- 385.5K All Categories
- 5.1K Data
- 2.5K Big Data Appliance
- 2.5K Data Science
- 453.4K Databases
- 223.2K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 47 Multilingual Engine
- 606 MySQL Community Space
- 486 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.2K ORDS, SODA & JSON in the Database
- 584 SQLcl
- 4K SQL Developer Data Modeler
- 188K SQL & PL/SQL
- 21.5K SQL Developer
- 45 Data Integration
- 45 GoldenGate
- 298.4K Development
- 4 Application Development
- 20 Developer Projects
- 166 Programming Languages
- 295K Development Tools
- 150 DevOps
- 3.1K QA/Testing
- 646.7K Java
- 37 Java Learning Subscription
- 37.1K Database Connectivity
- 201 Java Community Process
- 108 Java 25
- 22.2K Java APIs
- 138.3K Java Development Tools
- 165.4K Java EE (Java Enterprise Edition)
- 22 Java Essentials
- 176 Java 8 Questions
- 86K Java Programming
- 82 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 208 Java User Groups
- 25 JavaScript - Nashorn
- Programs
- 666 LiveLabs
- 41 Workshops
- 10.3K Software
- 6.7K Berkeley DB Family
- 3.6K JHeadstart
- 6K Other Languages
- 2.3K Chinese
- 207 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 474 Portuguese
A creation of ReplicatedEnvironment can hang on initialization of TupleBinding/IntegerBinding when a

Hi,
When 2 BDB JE environments (one replicated and another non-replicated) co-exist in the same JVM, the creation of replicated environment can hang occasionally.
The BDB JE environments are create in parallel threads.The issue was reported couple of times to me. A thread-dump was collected last time.
In the thread dump I could see that hanging happened on initialization of class "com.sleepycat.bind.tuple.TupleBinding" as below:
at com.sleepycat.bind.tuple.TupleBinding.<clinit>(TupleBinding.java:53) at com.sleepycat.je.cleaner.ExpirationProfile.populateCache(ExpirationProfile.java:193) - locked [email protected] at com.sleepycat.je.recovery.RecoveryManager.recover(RecoveryManager.java:434) at com.sleepycat.je.dbi.EnvironmentImpl.finishInit(EnvironmentImpl.java:841) - locked [email protected] at com.sleepycat.je.dbi.DbEnvPool.getEnvironment(DbEnvPool.java:222) at com.sleepycat.je.Environment.makeEnvironmentImpl(Environment.java:267) at com.sleepycat.je.Environment.<init>(Environment.java:252) at com.sleepycat.je.rep.ReplicatedEnvironment.<init>(ReplicatedEnvironment.java:607) at com.sleepycat.je.rep.ReplicatedEnvironment.<init>(ReplicatedEnvironment.java:466) at com.sleepycat.je.rep.ReplicatedEnvironment.<init>(ReplicatedEnvironment.java:540)
At line 53 of TupleBinding an instance of IntegerBindin is created and added into HashMap:
addPrimitive(Integer.class, Integer.TYPE, new IntegerBinding());
The other non-replicated environment instance was successfully created, however, the hung for this environment happened at the same time on invocation of BDB JE static method IntegerBinding.entryToInt(key).
The code where hanging happened looks like the one below
DatabaseEntry key = new DatabaseEntry(); DatabaseEntry value = new DatabaseEntry(); while(cursor.getNext(key, value, null) == OperationStatus.SUCCESS) { int i = IntegerBinding.entryToInt(key); // <!--- hang at this line...
It looks like a bizarre classloader issue to me. Perhaps, it would be better to raise a defect against JDK, but, before taking that route, I would like to clarify, whether anyone else experienced something similar. If so, is there is any way to work around it?
Th bdb je version in use is 7.4.5.
Here are some details of environments where issues happened.
JVM: Oracle Corporation, version: 1.8.0_144-b01, OS: Linux version: 2.6.18-423.el5, architecture: amd64, cores: 64
JVM: Oracle Corporation, version: 1.8.0_161-b12, OS: Linux version: 3.10.0-514.6.1.el7.x86_64, architecture: amd64, cores: 40
Please note that the reported issue occurs on application startup. The JVMs seem were not in any stress...
Kind Regards,
Alex
Answers
-
Hi,
I think it is a defect in BDB JE.
A number of JDK defect reports (JDK-6301579[1], JDK-8037567 [2]) was raised about the same problem with class initialization, but, they have been closed as "not an issue".
It seems Java spec does not allow static initializers to reference subclasses.
The TupleBinding is parent of IntegerBinding. In static block of TupleBinding an instance of IntegerBinding is created.
Kind Regards,
Alex