Object DB: Saving POJOs inside a Transaction
OrientDB v1.6.3
With no transactions it is possible to save a POJO to the database, which always results in an INSERT operation.
In contrast, saving a POJO inside a transaction leads to an exception stating that the object needs an @Version annotated field. But this would introduce an otherwise unnecessary dependency on the JPA to my simple data beans.
As a workaround, I'm currently creating proxied instances via db.newInstance() which can be saved inside the transaction. But this approach requires an open database connection where the instances are created, which I otherwise wouldn't need.
It would be nice if inserting a POJO into the database would also work inside transactions.
As another oddity I noticed the following: I have a DB-Proxy object instance loaded from the database with a List<> property mapped to a LINKLIST in the database. I then insert freshly created plain (non-proxy) object instances into that List<> property. It is now possible to save named proxy object instance to the database without getting any exceptions about missing @Version annotations...
Not relevant anymore, closing it.