Internal Website Search

101-150 of 200 results

Metamodel Attribute NOT EQUALS to same Attribute in a different EntityManager

from Metamodel of a differente EntityManager initialized on a @Controller @RequestMapping event. I ... is it: If I have two moments of initialization of "javax.persistence.metamodel" from EntityManager and these two metamodels come from different EntityManagers . One of these is on a @PostConstruct event

EntityManager getMetamodel() causes crash

I am trying to track down some obscure errors with multi-threading.  This involved looking at the EntityManager Metamodel but this caused an ObjectDB exception.  So I reverted ... ;password=admin;drop" EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); MyEntity

EntityManager creation taking long time

In our production environment, entity manager creation, the line below, sometimes take upto few ten's of seconds to create. Is there any reason that is known which may be causing this ? Any suggestions on how this can be addressed ?   EntityManager entityManager = factory.createEntityManager

Eclipse4 RCP - No Persistence provider for EntityManager

.PersistenceException: No Persistence provider for EntityManager I'm using the latest ObjectDB 2.6.2.b03 ... only this way (i.e. between building an EntityManagerFactory to building an EntityManager

EntityManager.refresh takes a long time

EntityManager .refresh takes a long time for entity object Person in this code:     logger.log(Level.INFO, "begin select for person " + new Date().toString());     ... level;   Does i understand this term correctly, if try to refresh Entitymanager updates

JPA - ExceptionInInitializerError when creating EntityManager

); //OUTPUT: EMF: org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl@ffa7e1 EntityManager emTemp ... ");         javax.persistence. EntityManager em = emf

javax.persistence.PersistenceException: No Persistence provider for EntityManager named in Karaf 4.0.7 and OSGi DS test

.persistence.PersistenceException: No Persistence provider for EntityManager named objectdb

EntityManager.merge gives EntityNotFoundException

Just started using objectdb (2.3.4). Calling EntityManager .merge for a new (non-managed) object gives EntityNotFoundException. I am perplexed by this. See attached test case. Thanks for your assistance. Full error output is: Exception in thread "main" [ObjectDB 2.3.4] javax.persistence

Executing JUnit "all tests" throws "Object ... belongs to another EntityManager" Exception

.Symbol#7' belongs to another EntityManager [Symbol:7] When I change the order in which the test runs (by

multi EntityManager with Spring Boot, but 'Too many persistable types (>10)

I'm trying to use two EntityManager with Spring Boot, but no luck with 'Too many persistable types (10) - exceeds evaluation limit' at second database. My purpose is converting database (converting model entity. same class name but different package). Single application with Spring-Boot 2.1.8

"No Persistence provider for EntityManager" in OSGI bundle.

provider for EntityManager named $objectdb/myDB.odb at javax.persistence.Persistence

Creation of several EntityManager is slower

Creation of several EntityManager is slower

Accessing objects to make them available after EntityManager close?!

Accessing objects to make them available after EntityManager close?!

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

DB persist operation results are not available for another Thread/EntityManager immdiately

Hello, we have following situation: The EntityManagerFactory is always opened and won't be closed. Thread A with its own EntityManager persists entities and commits the entities successfully. Thread B runs afterwards also with its own EntityManager and tries to load the persisted entities by

@OneToMany(fetch = FetchType.LAZY) list is always null

EntityManager entityManager ; @EJB private Manager manager; private List parents; @PostConstruct private void postConstruct() { Query query = entityManager .createQuery("SELECT p FROM Parent p"); parents ... EntityManager entityManager ; public void persist(Object o) { try { transaction.begin

InternalException during EntityManager.find()

InternalException during EntityManager.find()

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

javax.persistence.EntityManagerFactory

- if the entity manager factory has been closed Since: JPA 1.0 EntityManager createEntityManager () Create a new application-managed EntityManager . This method returns a new EntityManager instance ... Since: JPA 1.0 EntityManager createEntityManager (Map map) Create a new application-managed

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

javax.persistence.EntityNotFoundException

reference obtained by EntityManager .getReference is accessed but the entity does not exist. Thrown when EntityManager .refresh is called and the object no longer exists in the database. Thrown when EntityManager .lock is used with pessimistic locking is used and the entity no longer exists in the database

Should derived fields of an EmbeddedId be manually maintained by app code?

.persistence.Basic; import javax.persistence.Entity; import javax.persistence. EntityManager ; import javax ... EContainer { public static EContainer getInstance( EntityManager em) { EContainer c = em.find(EContainer ... void generateMapItems(Integer numberToGen, boolean subItems, EntityManager em) throws TestException

JBOSS AS7 7.1.1 - Entity not persisted and createNamedQuery fire exception

; import java.util.List; import javax.ejb.Stateless; import javax.persistence. EntityManager ; import javax ... database connection: @PersistenceContext(unitName = "guest-pu") private EntityManager em;   ... .persistence. EntityManager ; import javax.persistence.PersistenceContext; import javax.persistence.TypedQuery

Best setup for huge amount of transactions

have a single EntityManager open on the Manager object level. However, I wonder if I should have an EntityManager per Connection (but this would be up to 10,000 open EntityManagers ). Then I use ... . this . entityManager . getTransaction (). begin ();      this .device

javax.persistence.OptimisticLockException

time. The current transaction, if one is active, will be marked for rollback. See Also: EntityManager .find EntityManager .find EntityManager .lock EntityManager .lock Since: JPA 1.0 Public Constructors

EntityManagerFactory.createEntityManager() - JPA Method

JPA Method in javax.persistence.EntityManagerFactory EntityManager createEntityManager () Create a new application-managed EntityManager . This method returns a new EntityManager instance each time it is invoked. The isOpen method will return true on the returned instance. Return: entity manager

EntityManagerFactory.createEntityManager(synchronizationType,map) - JPA Method

JPA Method in javax.persistence.EntityManagerFactory EntityManager createEntityManager (   ... 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 isOpen method

EntityManagerFactory.createEntityManager(synchronizationType) - JPA Method

JPA Method in javax.persistence.EntityManagerFactory EntityManager createEntityManager (    SynchronizationType  synchronizationType ) Create a new JTA application-managed EntityManager with the specified synchronization type. This method returns a new EntityManager instance each

EntityManagerFactory.createEntityManager(map) - JPA Method

JPA Method in javax.persistence.EntityManagerFactory EntityManager createEntityManager (   Map map ) Create a new application-managed EntityManager with the specified Map of properties. This method returns a new EntityManager instance each time it is invoked. The isOpen method

javax.persistence.NamedStoredProcedureQuery

that is passed as an argument to the EntityManager .createNamedStoredProcedureQuery method to create ... to the query with the EntityManager methods that create stored procedure query objects. Since: JPA 2.1

javax.persistence.NamedQuery

is an example of the use of a named query: @PersistenceContext public EntityManager em; ... customers ... String name default null (Required) The name used to refer to the query with the EntityManager methods

javax.persistence.PersistenceContext

JPA Annotation PersistenceContext Target: TYPE, METHOD, FIELD Implemented Interfaces: Annotation Expresses a dependency on a container-managed EntityManager and its associated persistence context ... of the EntityManager joinTransaction method. Since: JPA 2.1 PersistenceContextType type default PersistenceContextType

javax.persistence.Persistence

: persistenceUnitName the - name of the persistence unit Return: the factory that creates EntityManagers ... EntityManagers configured according to the specified persistence unit. Since: JPA 1.0 void

javax.persistence.EntityExistsException

; javax.persistence.EntityExistsException Thrown by the persistence provider when EntityManager ... context has been joined to it, will be marked for rollback. See Also: javax.persistence. EntityManager

javax.persistence.PessimisticLockScope

JPA Enum PessimisticLockScope java.lang.Object ∟  java.lang.Enum ∟  javax.persistence.PessimisticLockScope Defines the values of the javax.persistence.lock.scope property for pessimistic locking. This property may be passed as an argument to the methods of the EntityManager , Query

javax.persistence.EntityTransaction

JPA Interface EntityTransaction Interface used to control transactions on resource-local entity managers. The EntityManager .getTransaction() method returns the EntityTransaction interface. Since: JPA 1.0 The Database Connection using JPA article explains how to use EntityTransaction . Public

javax.persistence.NamedStoredProcedureQuery.name

JPA Annotation Attribute in javax.persistence.NamedStoredProcedureQuery String name default null The name used to refer to the query with the EntityManager methods that create stored procedure query objects. Since: JPA 2.1

javax.persistence.NamedQuery.name

JPA Annotation Attribute in javax.persistence.NamedQuery String name default null (Required) The name used to refer to the query with the EntityManager methods that create query objects. Since: JPA 1.0

javax.persistence.LockModeType

JPA Enum LockModeType java.lang.Object ∟  java.lang.Enum ∟  javax.persistence.LockModeType Lock modes can be specified by means of passing a LockModeType argument to one of the javax.persistence. EntityManager methods that take locks ( lock , find , or refresh ) or to the Query

javax.persistence.NamedNativeQuery.name

JPA Annotation Attribute in javax.persistence.NamedNativeQuery String name default null The name used to refer to the query with the EntityManager methods that create query objects. Since: JPA 1.0

javax.persistence.NamedNativeQuery

.) Since: JPA 1.0 String name default null The name used to refer to the query with the EntityManager methods

javax.persistence.SynchronizationType

transaction by means of the EntityManager .joinTransaction method. Since: JPA 2.1 Enum Constants

Persistence.createEntityManagerFactory(persistenceUnitName,properties) - JPA Static Method

: the factory that creates EntityManagers configured according to the specified persistence unit. Since: JPA 1.0

javax.persistence.PersistenceContext.synchronization

must be explicitly joined to the current transaction by means of the EntityManager joinTransaction method. Since: JPA 2.1

Persistence.createEntityManagerFactory(persistenceUnitName) - JPA Static Method

: the factory that creates EntityManagers configured according to the specified persistence unit Since: JPA 1.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

NullPointer when accessing entity field

while the EntityManager is manipulated concurrently in another thread (e.g. transaction is committed or the EntityManager is closed). Is it possible that an EntityManager and/or its managed objects were accessed concurrently by more than one thread? support Support We are using EntityManagers in following way