About EntityManager

forum_thread

Error using query with MAX() function

I have a class that is persisting a Entity that holds remarks and a time. Then when I query for the latest remark I get a internal error when the remark is larger than 1966 chars. Here is a test class and entity that reproduces the problem on my system. ... emf ; private final EntityManager em ;   public Test ( ) ... If you are using EntityManager 's flush you should try build 2.2.3_04 that ...

 
issue

Negative snapshot user count

I finally hit an instance of the "Negative snapshot user count" exception 1) ... ) ;   EntityManager em = emf. createEntityManager ( ) ; ... ) { EntityManager em2 = emf. createEntityManager ( ) ; ...

 
forum_thread

Replication error - parsing objectdb config

I'm trying to replicate a database using the following config: <server>   <connection port="6136" max="100" />   <data path="$objectdb/db-files" />   <replication url="objectdb://localhost:6126/DEV1/NewMessagePipe.odb;user=admin;password=admin" /> </server> ... ) ; try { EntityManager masterManager = masterEmf. createEntityManager ( ... close ( ) ;   EntityManager replicatedManager = replicatedEmf. createEntityManager ...

 
issue

Removing of an entity removes also another entity type

Hello, we have following case: ToleranceDefinition and ResolverMapping are entities and have not any relations each other. Before start transaction the ToleranceDefinition entities exist already in the database. ... a ToleranceDefinition entity is removed from database by entitymanager.remove(obj). Directly after remove we try to retrieve again the ... that mixing direct DELETE / UPDATE database queries with EntityManager 's operations is known as problematic. It is not specific to ...

 
forum_thread

Version 2.2.7 build 7/8 issue

Hi all, I have problems with builds 7 and 8 when trying to sort entities with mappedBy and my own method in query. This query "SELECT c FROM Customer c order by c.getNormalizedName()" returns List with null objects! With builds 6 and 5 works it correctly. Removing mappedBy from @OneToOne(mappedBy = "address") also helps. My code: ... "$objectdb/db/test.odb" ) ; EntityManager em = emf. createEntityManager ( ) ; ...

 
forum_thread

Problem with @UniqueConstraint

It seems there is a problem with @UniqueConstraint. Same annotations using hibernate works fine - an error will be thrown - duplicate name. ObjectDB - no exception will be thrown. with best regardsPeter... ( PATH ) ; EntityManager em = emf. createEntityManager ( ) ; ...

 
forum_thread

How to delete M2M relationship?

In user model class I have the following: public class User implements Serializable { ... static boolean deleteUserTimeslot ( EntityManager em, Timeslot ts ) {   ...

 
forum_thread

Entity Management Config questions

Hi, the manual states the following regarding config of Entities: http://www.objectdb.com/java/jpa/setting/entities  : <cache ref="weak" level2="0mb" /> The <cache> element specifies settings of the two cache mechanisms for entities:... dirty entities in the persistence context of the EntityManager javax.persistence.EntityManager JPA interface Interface used to interact with the ...

 
forum_thread

Empty query results after JAR creation

Hi, I struggle with a strange issue. I've embedded ObjectDB in a small application to query cases. Within Netbeans everything works fine but when I create a  JAR File and executed via "Java -Jar xyz.jar", I get either empty results or on some cases a "NoResultException" which appears to report the same issue. I've created a small test case (attached zip file) with sample DB to reproduce the issue.  ... "src/main/resources/TravelDB.odb" ) ; EntityManager em = emf. createEntityManager ( ) ; ...

 
issue

Merge throw exception "Attempt to reuse an existing primary key value"

Hi,   if Id = 0 I got javax.persistence.EntityExistsException: com.objectdb.o.UserException: Attempt to reuse an existing primary key value (ru.dz.train.test.ZeroIdTest$MyEntity:0)   if Id=1 no exception code : ... ) ;   EntityManager em = emf. createEntityManager ( ) ; ...