About merge

forum_thread

Object DB vs EclipseLink/TopLink: Unloaded relationships in detached entities

This topic is for those considering migrating from EclipseLink JPA or TopLink to ObjectDB JPA. ... from the database, when it needs it (without any merge call). From doug clarke ...

 
forum_thread

Update is ignored by ObjectDB

Hi! Sorry for my bad english skills. When I execute fulfilOrder, only Order entity is updated in the database, and User entity remains modified only in code, even if I go: user = smdb.find(User.class, user.id); In this source highlighted lines modifying entity, but not the database. ... += item. total ; // <-this smdb. merge ( user ) ; // <-and this order = new ... lib. updateUser ( user ) ; // it's em.merge(user); So my question : Is it impossible to perform two ...

 
forum_thread

persists and update together ?

hello on mysql i've seen;   INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6) ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);   This query , inserts data or updates if its already available and this will reduce finding same object again. On jpa : User obj2 = ...; ... 15:30 Maybe merge instead of persist is what you are looking for. ...

 
forum_thread

Complex Schema Upgrade not working

Hello, We're trying to upgrade the DB-Schema. Simplied our source/original Schema/Class-Hierarchy looked like this: class contact.Contact class customer.Customer extends contact.Contact class member.Member extends customer.Customer We have database records within each class type (Contact, Customer and Member). #1 2015-01-19 09:38 Hello, We're trying to upgrade the DB-Schema. Simplied our source/original Schema/Class-Hierarchy loo ...

 
forum_thread

Package name for persisted entities

Hi, I have a question about package name and searching for entities. As for now we were using two different databases for two different parts of our system. But we want to make a 'common' model for both systems. After merging entities from two different projects, we get single jar with all entities. Unfortunately some of the names are the same for entities: - homplex.model.dbobject.Inspiration - pl.hplxtool.model.Inspiration #1 2011-10-31 11:59 Hi, I have a question about package name and searching for entities. As for now we were using two differe ...

 
forum_thread

Removing an entity throws exception

Hi all, I'm testing ObjectDB for my project, but I have troubles with it. At this time I'm not able to remove customer entity, when it's read by a query (it's attached), it throws this exception: Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: com.objectdb.o._RollbackException: Failed to commit transaction: 51 ... ... After this exception is the entity detached (why?). When I merge it, I can remove it without problems... The Customer class code: ... ) ; try { //c = em.merge(c); em. remove ( c ) ; em. ...

 
forum_thread

On ensuring ID available after persist

This reports on a possible solution to a common problem: I was trialling ObjectDB on an existing, functioning, large JavaEE/JPA web application, which until now had used EclipseLink+MySQL and then Oracle+MySQL. On trying it out on ObjectDB I hit a problem with my very extensive entity wiring code, which relies on an "external" entity object having a non-null id after it has been passed to EntityManager.persist, thus: ... "Make an instance managed and persistent.", and unlike merge() there is no managed entity returned. My copious entity wiring code ...

 
api-jpa

javax.persistence.Version

Specifies the version field or property of an entity class that serves as its optimistic lock value.(Annotation of JPA)

 
forum_thread

Suspected memleak caused by bad state of EntityManager

Our application manages the Entities itself, so we close the EntityManager after every creating and using. We find a slow memleak in our application recently, and by trace of Entity construct and finalize, we found the problem is caused by bad state of EntityManager. After first throwing the InternalException, the EntityManager throws every time when doing merge operation, but it can be closed and retrieved by EntityManagerFactory, and the instances of Entity constructed by ObjectDB can never be released by JVM.There is a chart describes the instances exists in memory.... the EntityManager throws every time when doing merge operation, but it can be closed and retrieved by EntityManagerFactory, ...

 
forum_thread

Significant I/O costs during batch update or insert data.

Our application has some complex entities. We do batch update(merge detached entity) every 2 minutes. We find the period significant IO costs these days, and disappeared when turn off the batch updating. 1.ObjectDB is in embedded mode. 2.ObjectDB version is 2.3.7 3.Database file size is nearly 600mb and increasing. ... application has some complex entities. We do batch update(merge detached entity) every 2 minutes. We find the period significant IO costs ...