About EntityManager

forum_thread

Caching/Paging Questions...

Greetings ObjectDB team, All below questions assume a very large database (~1,000,000,000 objects): Q1: Two queries with a big overlap between their result sets. If I query the first set and hold the results in memory somehow, would that speed up the execution of the second query since many of its result objects already created and reside in memory ?... What is the maximum memory size of ObjectDB L2 cache or EntityManager context ? Q4: Would paging result sets via setFirstResult ... directly by the content of the persistence context (the EntityManager L1 cache) but instantiation of the results (if they contain ...

 
forum_thread

Embedded mode usage question

Hi there ! ... multi threading you just have to use a separate EntityManager for every thread (e.g. EntityManager per request in a web application, as demonstrated in that ...

 
forum_thread

Storing Images and Object Pooling

Hello we have heard your product and we will plan to use your product on image database. Is it good to use ObjectDB as image database? Image database just screenshots of desktops.   2- ) On JPA as we know getting Result list returns ArrayList         List<SomeClass> xxx = query.getResultList(); ... However, notice that objects are cached as objects per EntityManager , so you will have to use long term shared EntityManager to benefit from this object pooling. ...

 
forum_thread

ODB lost?

I'm new to ObjectDB. While debugging small programs in single-step mode in NetBeans, the ODB appears to get corrupted or lost if I don't invoke close on EntityManager. If I re-run my program and get a new EntityManager, the instance behaves as if the data that was persisting is somehow gone. I noticed in the file system, indeed, the .odb file is gone, but there are <name>_<v>.odb files where <name> is the name of my odb and <v> is apparently a version number. Is there any way to recover <name>.odb? ... to get corrupted or lost if I don't invoke close on EntityManager. If I re-run my program and get a new EntityManager, the instance behaves as if the data that was persisting is ...

 
forum_thread

Online backup with JDO

Hi, I would like to try the Online Backup tool as I am making backups up to now with the not encouraged file-copying method while the database is online. So my first question is to this file-copying. I've read at the Database Doctor that copying the db file while it is online may cause corrupted DB file. Does this mean that the copy can be corrupted or even the source file ? My second question is about starting the online backup. The manual suggests starting it via the EntityManager with the code ... the online backup. The manual suggests starting it via the EntityManager with the code em. createQuery ( "objectdb ... the above code still work for me if I arrange having an EntityManager upon my DB file? Or does some equivalent syntax work with JDO too ...

 
forum_thread

Detecting ObjectDB alive

Hi, I'm wondering how best to be able to detect if ObjectDb Server is alive? For: a) from a java process - I'm guessing you could try and grab a Persistence Manager and/or listen for a Disconnection Exception?? b) from a NodeJs runtime - I'm guessing you could either try and grab the ObjectDb server port and that won't be possible as long as the Objectdb Server is running. Is there a way to polling server from TCP and/or HTTP ?   ... a port) is to test it periodically, e.g. by obtaining an EntityManager , making some operation against the database and then closing the  EntityManager . ObjectDB Support ObjectDB - Fast ...

 
forum_thread

Performance Questions...

Greetings ObjectDB team, All below questions assume a very large database (~1,000,000,000 objects) Q1: Two queries with a big overlap between their result sets. If I query the first and hold them in memory somehow, would that speed up the execution of the second query since many of its result objects already created and reside in memory ? Q2: Do I need to manually use strong references to such cached result objects ? or do ObjectDB exploits frequency of querying such objects and keep them in memory longer automatically somehow before GC takes place ?... database is read only it might be easier to share the same EntityManager by different threads, increasing the effectiveness of the EntityManager's persistence context (L1) cache. But otherwise read only ...

 
forum_thread

Criteria query error: Unexpected query token

Using JPA2, I can save entities now in JBoss, and also fetch them uniquely by id. However, if I try to fetch it by getting back all instances (e.g. findAll, I get the following error:   ... { CriteriaBuilder qb = entityManager. getCriteriaBuilder ( ) ; ... from ( aClass ) ; return entityManager. createQuery ( c ) . getResultList ( ...

 
forum_thread

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

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

 
forum_thread

UserException: Invalid configuration in 'internal' - Check permissions

Hi all,   I have a master/slave code so that each slave reads a subset of points of the same database. ObjectDB entities do not allow serialization and so I have sent, to each slave, the file path. With such information I have tried to create an entityManager, in each slave, as follows: EntityManagerFatory entityManagerFactory = Persistence.createEntityManagerFactory(filePath); EntityManager = entityManagerFactory.createEntityManager(); However I get the following error ... file path. With such information I have tried to create an entityManager, in each slave, as follows: <span> ... ( filePath ) ; EntityManager = entityManagerFactory.createEntityManager ( ) ; ...