Attempt to refresh a non managed entity object (error 635)

#1

Just ran into a problem that I've not seen in 10 years of running ObjectDb:

java.lang.IllegalArgumentException
Attempt to refresh a non managed entity object (error 635)

Nothing changed in my code, but I'm wondering if there is a problem with the config file, and /or my recent experiments with Intellij's JPA database explorer, which required me to use a JPA persistence.xml configuration file.

(I was able to use to run objectdb queries from inside Intellij).

At any rate, it's made me wonder what the best practise is with this issue in general, and with EntityManager in particular.

Specifically: is it advised to use a new EntityManager with every transaction, or to use one, and clear() it with every transaction (in an application with one thread handling all the business logic) ?

#2

This error message indicates invoking refresh (explicitly or implicitly by cascading) on a non managed entity object, i.e. a new entity object that has not been persisted yet, or a detached entity object (e.g. after clear).

It doesn't seem to be related to the IDE that you use.

ObjectDB Support
#3

Still having problems here.

Was going to put a long posting here, but I think I'll explore on my own a bit more.

Am thinking it's time to really dig into the configuration parameters, am noticing a few weird things in my tests, for example, managed, but objects surviving a rollback.

Pretty sure that my configuration is not right.

Reply