ObjectDB Database Search

101-150 of 200 results

Is it possible to remove parent/child entities without refresh?

We have a big entity object tree in our project. If I use the entityManager .remove(childEntity) method to remove a child entity a entityManager .refresh(parentEntity) is necessary in order to have an updated parent/child object tree in memory. But entityManager .refresh is too slow for our project

Merge with Parent/Child entities not possible

.persistence.Entity; import javax.persistence. EntityManager ; import javax.persistence.EntityManagerFactory ... void setId(long id) {    this.id = id;   } } private EntityManager ... ; EntityManager entityManager = emf.createEntityManager();   entityManager .setFlushMode(FlushModeType.AUTO

Updating Entities

= Persistence.createEntityManagerFactory("$objectdb/db/payrollDB.odb"); public static EntityManager employeeDB = emf.createEntityManager(); public static EntityManager paygradeDB = emf ... was accurate. To me, this indicated that the two separate EntityManagers were not communicating

jakarta.persistence.EntityManagerFactory.runInTransaction(Consumer)

(    Consumer work ) Create a new application-managed EntityManager with an active transaction, and execute the given function, passing the EntityManager to the function. If the transaction ... with the caller, then the EntityManager is associated with this current transaction. If the given function

jakarta.persistence.EntityManagerFactory.callInTransaction(Function)

(    Function work ) Create a new application-managed EntityManager with an active transaction, and call the given function, passing the EntityManager to the function. If the transaction type ... , then the EntityManager is associated with this current transaction. If the given function returns

Memory Leaks after COMMIT operation (checked on versions 2.6.5 & 2.6.6.b01)

_ EntityManager = m_EntityMgrFactory.createEntityManager(); m_ EntityManager .setFlushMode( FlushModeType.COMMIT ); if ( m_ EntityManager .isOpen() ) { m_ EntityManager .getTransaction().begin(); for ( Pa3DataKey dataKey : aDataKeys ) { m_ EntityManager .persist( dataKey ); } m_ EntityManager .getTransaction().commit

jakarta.persistence.EntityManagerFactory.createEntityManager()

Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManagerFactory EntityManager createEntityManager() Create a new application-managed EntityManager . This method returns a new EntityManager instance each time it is invoked. The EntityManager .isOpen method will return true

jakarta.persistence.EntityManagerFactory.createEntityManager(Map)

Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManagerFactory EntityManager createEntityManager (    Map map ) Create a new application-managed EntityManager with the given Map specifying property settings. This method returns a new EntityManager instance each time

jakarta.persistence.EntityManagerFactory.createEntityManager(SynchronizationType)

Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManagerFactory EntityManager ... -managed EntityManager with the specified synchronization type. This method returns a new EntityManager instance each time it is invoked. The EntityManager .isOpen method will return true on the returned

jakarta.persistence.EntityManagerFactory.createEntityManager(SynchronizationType,Map)

Jakarta Persistence (JPA) Method in jakarta.persistence.EntityManagerFactory EntityManager ... a new JTA application-managed EntityManager with the specified synchronization type and map of properties. This method returns a new EntityManager instance each time it is invoked. The EntityManager

jakarta.persistence.FlushModeType

Enumerates flush modes recognized by the EntityManager . When queries are executed ... transaction, the persistence provider must not flush to the database. See Also: EntityManager

jakarta.persistence.LockOption

Jakarta Persistence (JPA) Interface jakarta.persistence.LockOption An option influencing the behavior of EntityManager .lock . Built-in options control scope , and timeouts . This interface ... . See Also: LockModeType PessimisticLockScope Timeout EntityManager .lock(Object, LockModeType, LockOption...) Since: Jakarta Persistence (JPA) 3.2

jakarta.persistence.EntityExistsException

the persistence provider when EntityManager .persist is called and the entity already exists ... . See Also: EntityManager .persist(Object) Since: Jakarta Persistence (JPA) 1.0 Public Constructors

Optimistic locking: prevent version increment on entity collection attribute

with the EntityManager's life cycle but cannot figure out what. I am using Guice injection and Guice persist and should get one EntityManager per request. Also, please note that in the web app I actually ... ;  } } public void test() {     // em is the EntityManager     em

jakarta.persistence.EntityManagerFactory.addNamedQuery(String,Query)

the EntityManager .createNamedQuery or EntityManager .createNamedStoredProcedureQuery methods. Any configuration

Missing (null) elements in eager loaded references

(all of them)? Does it happen when the EntityManager is open or closed? Note that if you are working with detached objects (e.g. after closing the EntityManager ) then anything that has not ... yet resolved before the elements are returned and the EntityManager is closed? Kevin Kevin Pfaff So you say

Memory Leak in EntityManagerFactory ?

(db_name) 3. After runnings some automatic tests for ca. 1 h all EntityManagers are closed ... the Database but more the 236 Copies of those entitities in the memory (after closing all EntityManagers ... an EntityManager  in the connection pool of a live E ntityManagerFactory , where that EntityManager

Internal exception when updating date filed (TemporalType.DATE)

entityManagerFactory;         private EntityManager entityManager ... ;  entityManager = entityManagerFactory.createEntityManager();        ... ;    entityManager .getTransaction().begin();        

Persist error @ManyToMany how to define correct entities relationships

.CascadeType; import javax.persistence.Entity; import javax.persistence. EntityManager ; import javax ... t = new Test(); t.test(); } public static class Test{ EntityManagerFactory emf; EntityManager em ... javax.persistence. EntityManager ; import javax.persistence.EntityManagerFactory; import javax

jakarta.persistence.PersistenceUnitTransactionType

Jakarta Persistence. An EntityManager may be a JTA entity manager, where transaction management

jakarta.persistence.LockModeType

as an argument to: one of the methods of EntityManager which obtains locks ( lock() , find() , or

jakarta.persistence.ConnectionConsumer

EntityManager .runWithConnection(ConnectionConsumer) Since: Jakarta Persistence (JPA) 3.2 Public Instance

jakarta.persistence.ConnectionFunction

EntityManager .callWithConnection(ConnectionFunction) Since: Jakarta Persistence (JPA) 3.2 Public

jakarta.persistence.EntityTransaction

Jakarta Persistence (JPA) Interface jakarta.persistence.EntityTransaction Interface used to control transactions on resource-local entity managers. The EntityManager .getTransaction method returns the EntityTransaction interface. Since: Jakarta Persistence (JPA) 1.0 The Database Connection using

jakarta.persistence.TypedQueryReference

Jakarta Persistence (JPA) Interface jakarta.persistence.TypedQueryReference Type Parameters: - an upper bound on the result type of the query A reference to a named query declared via the NamedQuery or NamedNativeQuery annotations. See Also: EntityManager .createQuery(TypedQueryReference

Problem on JPA Merge Entity.

Hello, I have a problem with the EntityManager .merge() function. I set a property value ... ErgoDaoJpa implements IErgoDao { @PersistenceContext private EntityManager entityManager ; public void ... ; throws EntryAlreadyExistException, DaoException { entityManager .persist(ergoClass); } public void

Filename.odb$ Persisting Issue

; static EntityManager departmentDB = emf.createEntityManager(); public  static EntityManager employeeDB = emf.createEntityManager(); public  static EntityManager paygradeDB = emf.createEntityManager(); public  static EntityManager programDB = emf.createEntityManager(); public  static

Mismatch client-server protocol prefix

EntityManager ) by two concurrent threads. ObjectDB synchronizes use of EntityManager by different threads ... implementation. Maybe a socket from a closed EntityManager is still used after the EntityManager is closed after its resources are allocated and used by a new EntityManager . You may try the following

openejb jpa jaas module

.persistence. EntityManager ; import javax.persistence.EntityManagerFactory; import javax.persistence ... entityManagerFactory; private EntityManager entityManager ; protected Map sharedState = new HashMap (); private ... = Persistence.createEntityManagerFactory((String) options.get("url")); entityManager

Conflicting modifiers .... (javax.persistence.Id, javax.persistence.ManyToOne)

.persistence.Basic; import javax.persistence.Entity; import javax.persistence. EntityManager ; import javax ... static Container getInstance( EntityManager em) { Container c = em.find(Container.class, "1"); if (c ... (Integer numberToGen, EntityManager em) throws TestException { if (lastInstanceInMap == null

Entity listener - event instead of object

database. I can't find the nice way to use EntityManager in EntityListener. Because of that, I can't ... to obtain an EntityManager from a listener class? You may use the JDO getPersistenceManager method and cast the result to an  EntityManager . support Support I know about this feature request

Duplicate Entity class names causes Exception in Query

class Singleton implements Serializable { public static Singleton getInstance( EntityManager em ... int version; @Basic protected java.lang.Integer lastInstance; public void generateItems( EntityManager ... (this, startCnt); em.persist(item); lastInstance = startCnt; } } public Item findItem( EntityManager em, int

Cannot save or update entity on Spring App

: @PersistenceContext private EntityManager em; // Stores a new guest: @Transactional public Language persist ... _ ENTITYMANAGER _PACKAGES_TO_SCAN)); entityManagerFactoryBean.setJpaVendorAdapter(new ... entityManagerFactory; // Stores a new guest: public Object persist(Object guest) { EntityManager em

Database is erased after deploying a new web application version

? When should I use the close method of EntityManagerFactory and  EntityManager ? As long as ... the close method of EntityManagerFactory and  EntityManager ? You can close the  EntityManagerFactory when the web application is closed (see this example ). Usually  EntityManager

Type xxx is not found (error 301)

PersistenceManager from your EntityManager :     em.unwrap(PersistenceManager.class ... on my EntityManager ?? also, I don't have a query (String, Class) method on my EntityManager dmoshal ... as the 2nd argument. oddly, I don't have an unwrap() method on my EntityManager ?? also, I don't

How to Remove records from many to many relationship tables in JPA

removeConclusions(Long id) { entityManager = dbConn.getConnection(); Conclusion conclusion = entityManager .find(Conclusion.class, id); entityManager .getTransaction().begin(); entityManager .remove(conclusion); entityManager .getTransaction().commit(); } but iam getting constraint violation error . 

NoSuchFieldError: __odbTracker on NetBeans 7.3 + JBoss 7.1.1

("Москва"); person.setCity(city); entityManager .persist(city); entityManager .persist(person ... .setName(name); entityManager .persist(person); City city = new City(); city.setName("Москва"); person.setCity(city); entityManager .persist(city); entityManager .persist(person);   but JBoss throw

Unexpected behaviour upon update. Bug?

;  Persistence.createEntityManagerFactory("ODB.odb"); EntityManager em = emf ... ); } } nullcrud N J It seems to work as expected. The entity object is cached in the EntityManager  as ... one EntityManager instance are invisible in other  EntityManager instances until commit, but visible in

Transaction isolation support?

when the fetch start? Martin   mt Martin Every EntityManager manages its own memory objects (which represent database objects). Therefore, if an entity object is retrieved by one EntityManager and then updated in the database by another EntityManager , the first  EntityManager may still have an old

jakarta.persistence.PersistenceContext.synchronization

to the current transaction by means of the EntityManager .joinTransaction method. Default

jakarta.persistence.EntityManagerFactory.getCriteriaBuilder()

manager factory has been closed. See Also: EntityManager .getCriteriaBuilder() Since: Jakarta Persistence (JPA) 2.0

Removing of an entity removes also another entity type

with a result and after that a ToleranceDefinition entity is removed from database by entitymanager ... / UPDATE database queries with EntityManager 's operations is known as problematic. It is not specific to ObjectDB but general to JPA. DELETE / UPDATE JPA queries bypass the  EntityManager

Remove of an entry from a @OneToMany collection is not possible if the enhancer is disabled

. EntityManager ; import javax.persistence.EntityManagerFactory; import javax.persistence.FetchType; import ... ; EntityManager entityManager = emf.createEntityManager();   ParentEntity parentEntity = new ParentEntity();   entityManager .getTransaction().begin();   entityManager .persist(parentEntity

[ObjectDB 2.2.6_02] Unexpected exception (Error 990) at com.objectdb.o.OBC.aJ(OBC.java:961)

.persistence. EntityManager ; import javax.persistence.EntityManagerFactory; import javax.persistence ... () { emf = Persistence.createEntityManagerFactory("ReproducePU"); }   public EntityManager ... findMomentEntity(Long id) { EntityManager em = getEntityManager(); try { return em.find(MomentEntity.class, id

Once served to JSF page via @EJB query bean, many list fields are null (but same query ok after fresh persist in @PostConstruct)

; @PersistenceContext     private EntityManager em;     public List findElements ... with ObjectDB behavior in this case. Your TestQuery class uses a transaction scope EntityManager ... to extended scope EntityManager By doing that you prevent detachment on exit from findElements

After using the enhancer, Lazy loaded collections are no longer loading. They are set as null

; } } /** Workflow **/ Account account = new Account(); entityManager .persist(account); entityManager .flush(); Project project = new Project(); project.setAccount(account); entityManager .persist(project); entityManager .flush(); account = entityManager .find(account); assertNonNull(account.getProjects

JQL-Update Queries fails with activated L2-Cache

When using JQL-Update Queries it is basically not working without calling entityManager .clear() after a transaction commit. When the clear() method isn't called the entityManager will never return ... cautiously because bypassing the EntityManager may break its synchronization with the database. For example

spuriously objectdb objects have null references

entityManager per thread and have a central point where we encapsulated all the needed entitymanager ... Object(); public static void begin( EntityManager threadEntityManager){ synchronized(lockBegin){ try ... is detached (e.g. when the EntityManager is closed), ObjectDB replaces lazy loaded collections

new objects not available in mappedBy associations

object after the transaction is committed (or after the update and before commit, if your EntityManager ... the second query. Do I need to call refresh() on the object, query, or EntityManager ? ps: setting FlushModeType.AUTO in the EntityManager resulted in a huge exception message. dmoshal David Moshal Hmm, I

Feature suggestion: auto-detection of entities via persistence.xml extension

I am encountering problems (complexities) with EntityManager registration of entities ... system: hibernate.archive.autodetection https://docs.jboss.org/hibernate/ entitymanager /3.6/reference/en ... to the EntityManager whether one performs compile-time enhancement or runtime enhancement ? That is, does