About EntityManager

forum_thread

UserException or JDOUserException

I received an Exception:  "com.objectdb.o.UserException: Attempt to obtain a transaction using a closed EntityManager" Should I ever see a "UserException"?  Should it have been converted to a "JDOUserException" and that should have been returned instead? ... Attempt to obtain a transaction using a closed EntityManager" Should I ever see a "UserException"?  Should it ... : Attempt to obtain a transaction using a closed EntityManager at com. objectdb . o . MSG . d ( MSG. java ...

 
forum_thread

Java 6/7 Performance Comparison

Hey, I've been using ObjectDB for a small scale home project to gain some familiarity before proposing it in a commercial project at work. What I've noticed though is that when using objectdb in embedded mode based on the console tutorial, there seems to be a bit of a performance gap running the same code between Java 6 & 7 Tracing it through I can see the bottle neck seems to be at the creation of the entity manager and I was wondering if there are any additional configuration options I may have missed while running under java 7. ... ( "$objectdb/db/points.odb" ) ; EntityManager em = emf. createEntityManager ( ) ; ... Opening an EntityManagerFactory and an EntityManager should never take 30 seconds. Most ObjectDB users use Java 7, ...

 
forum_thread

Attempt to begin a new transaction when a transaction is active

The code I have a RecordDao stateless java bean :  ... EntityManagerFactory emf ; private EntityManager em ;   public RecordDao ( ) ... do not instantiate the EntityManagerFactory and the EntityManager explicitly, but let the application server do it for you (see ...

 
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

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 ...

 
forum_thread

IN operator syntax

Hi, what is the correct syntax for IN operator when list of literals ia used instead of parameter, e.g. SELECT FROM Info i WHERE i.status IN (1,4) ? (Suppose status is int.) I always get this exception: SELECT FROM Info i WHERE i.status IN (1 ==> , <== 4) javax.persistence.PersistenceException Unexpected query token ',' (closing ')' is missing) (error 752)   Query with only one item in list works fine: ... ) ; EntityManager em = emf. createEntityManager ( ) ; ...

 
forum_thread

Database absolute filepath

Is there a line of code that can be used to print out my databases absolute path? I have set it as follows: EntityManagerFactory emf = Persistence.createEntityManagerFactory("$objectdb/database/people.odb"); However, the data being shown in *\lib\objectdb\database\people.odb* is different than what is being used in the rest of the application so I think there might be more than one database somehow.... ) ) ;   EntityManager em = emf. createEntityManager ( ) ; ...

 
issue

JPQL support for mapped by (inverse) collections

As discussed and demonstrated in this forum thread, collection methods (IS EMPTY, SIZE, MEMBER OF, IN) are not supported for mapped by (inverse) collections.   ... "objectdb:test.tmp;drop" ) ; EntityManager em = emf. createEntityManager ( ) ; ...