Home » Support » Forum » Getting java.lang.ArithmeticException: / by zero

Getting java.lang.ArithmeticException: / by zero

#1

HI,

I am using ObjectDb 1.x and getting the following exception while calling the following code

PersistenceManager pm = getPersistenceManager();

if (!pm.isClosed()){
                        pm.evictAll();
                        pm.close();
                    }

Most of the times, the above code works fine, but sometimes it is observed that calling pm.close() is throwing the following exception

ava.lang.ArithmeticException: / by zero
at com.objectdb.td.remove(td.java:131)
at com.objectdb.af.VW(af.java:1149)
at com.objectdb.af.W8(af.java:1137)
at com.objectdb.af.E1(af.java:2560)
at com.objectdb.af.close(af.java:439)
at com.objectdb.jdo.PMImpl.close(PMImpl.java:148)

Can you please let me know what could be the reason of the above exception.

 

Thanks & regards,
Binit Bhaskar

 

 

 

#2

ObjectDB 1.x is not supported anymore and it is highly recommended to upgrade to ObjectDB 2.

But I can check the stack trace if you provide the exact build number that you use (or upload the ObjectDB jar file).

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#3

Please find the attached object db jar.

#4

I couldn't find the build number. It may be a very old jar.

Please try the attached jar, which is the last build of ObjectDB 1.x embedded.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#5

Hi,

Thanks for the jar. May be we use the latest jar in the next release.

The build number of the odbee jar which is being used is 2302

Regards,
Binit Bhaskar

#6

This division by zero occurs in some hash table that happens to have a 0 size (but I don't know why). You are using version 1.0.3 which is almost 7 years old. Many bugs have been fixed since then also in versions 1.0.4 and 1.0.5. But upgrading to ObjectDB 2.x would be better, if possible.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login