[Hibernate-JIRA] Created: (HHH-5039) Entity added instead of replaced in StateFullPersistenceContext during an update
by Ed Bras (JIRA)
Entity added instead of replaced in StateFullPersistenceContext during an update
--------------------------------------------------------------------------------
Key: HHH-5039
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5039
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.3.2
Environment: Windows 7
Reporter: Ed Bras
Hibernate bug (version: 3.3.2):
Entity added instead of replaced in StateFullPersistenceContext during an update.
Exception that occurs (only the interesting parts):
----
Caused by: org.hibernate.PropertyAccessException: could not get a field value by reflection getter of com.bv.core.domain.category.impl.IncomeInfoDefault.wage
at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:58)
at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValue(AbstractComponentTuplizer.java:87)
at org.hibernate.type.ComponentType.getPropertyValue(ComponentType.java:366)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.getComponentValue(AbstractEntityTuplizer.java:335)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:306)
at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:3600)
at org.hibernate.engine.StatefulPersistenceContext.isFoundInParent(StatefulPersistenceContext.java:1186)
at org.hibernate.engine.StatefulPersistenceContext.getOwnerId(StatefulPersistenceContext.java:1113)
at org.hibernate.property.BackrefPropertyAccessor$BackrefGetter.getForInsert(BackrefPropertyAccessor.java:139)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValuesToInsert(AbstractEntityTuplizer.java:287)
at org.hibernate.tuple.entity.PojoEntityTuplizer.getPropertyValuesToInsert(PojoEntityTuplizer.java:256)
at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValuesToInsert(AbstractEntityPersister.java:3677)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:144)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:535)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:527)
at org.hibernate.engine.CascadingAction$5.cascade(CascadingAction.java:241)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:292)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:240)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:193)
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:320)
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:266)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:243)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:193)
at org.hibernate.engine.Cascade.cascadeComponent(Cascade.java:222)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:203)
at org.hibernate.engine.Cascade.cascadeComponent(Cascade.java:222)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:203)
at org.hibernate.engine.Cascade.cascade(Cascade.java:154)
at org.hibernate.engine.Cascade.cascade(Cascade.java:121)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.cascadeOnUpdate(DefaultSaveOrUpdateEventListener.java:380)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:352)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:246)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:112)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:535)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:527)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:523)
at com.ited.hibernate.impl.DaoHibernateBase.saveOrUpdateEntity(DaoHibernateBase.java:55)
at com.ited.hibernate.impl.DaoHibernateBase.saveOrUpdateEntity(DaoHibernateBase.java:1)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy12.saveOrUpdateEntity(Unknown Source)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.ited.lang.proxy.intern.impl.MethodInvokerDefault.invokeMethod(MethodInvokerDefault.java:79)
at com.ited.lang.proxy.intern.impl.MethodInvokerDefault.invoke(MethodInvokerDefault.java:69)
at com.ited.lang.proxy.impl.ProxyMethodDefault.invoke(ProxyMethodDefault.java:369)
at com.ited.lang.proxy.impl.ProxyMethodDefault.invoke(ProxyMethodDefault.java:174)
at com.ited.persist.ProxyMethodDaoHibernate.invoke(ProxyMethodDaoHibernate.java:56)
... 62 more
Caused by: java.lang.NullPointerException
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:36)
at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:18)
at java.lang.reflect.Field.get(Field.java:358)
at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:55)
... 126 more
----
Sorry for not having a test case, but it occurs under a combination of curcumstances and is a bit complex.
I do the following:
Object graph:
Entity E1 has an association to E2 with a cascade update/delete. E2 is dependent on E1 and should be a Value type object, but I made it a entity for performance reasons to get lazy loading. E1 and E2 share the same String id (UUID).
E2 has 2 other Value type associations V1 and V2.
Actions:
I create a new E1 with E2 and no V1 and V2, and saveOrUpdate this in one transaction to the database.
Then I create a NEW E2 (with the same Id as the old E1), add V1 and V2 to E2 and saveOrUpdate only E2 and get the exception above.
BTW: I changed my code now such that E2 can't be replaced by another version with the same ID, which I think is also more "healhty", but I think that still Hibernate should be able to deal with this situation.
What happens in the Hibernate code:
When I saveOrUpdate E2, it will first call StatefulPersistenceContext.addEntry from DefaultSaveOrUpdateEventListener.performUpdate
The call trace of this call:
-------------
StatefulPersistenceContext.addEntry(Object, Status, Object[], Object, Serializable, Object, LockMode, boolean, EntityPersister, boolean, boolean) line: 481
StatefulPersistenceContext.addEntity(Object, Status, Object[], EntityKey, Object, LockMode, boolean, EntityPersister, boolean, boolean) line: 433
DefaultSaveOrUpdateEventListener.performUpdate(SaveOrUpdateEvent, Object, EntityPersister) line: 330
DefaultSaveOrUpdateEventListener.entityIsDetached(SaveOrUpdateEvent) line: 246
DefaultSaveOrUpdateEventListener.performSaveOrUpdate(SaveOrUpdateEvent) line: 112
DefaultSaveOrUpdateEventListener.onSaveOrUpdate(SaveOrUpdateEvent) line: 93
SessionImpl.fireSaveOrUpdate(SaveOrUpdateEvent) line: 535
SessionImpl.saveOrUpdate(String, Object) line: 527
SessionImpl.saveOrUpdate(Object) line: 523
DaoHibernateBase.saveOrUpdateEntity(Serializable) line: 55
DaoHibernateBase.saveOrUpdateEntity(Object) line: 1
GeneratedMethodAccessor18.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
-------------
Because this entity is already present (because the old Id of E2 was used) in entityEntries it will NOT be added, leaving the old one in the entityEntries (idea: maybe Hibernate should throw an exception in this case... ).
Hibernate will then perform cascading updates of V1 and V2. It will then call StatefulPersistenceContext.getOwnerId and will retrieve the OLD E2 from entityEntries. Because the old E2 has no V1 and V2 it will throw a null pointer exception when using this one to access the field.
The call trace just before the exception:
-------------
Thread [main] (Suspended (breakpoint at line 58 in DirectPropertyAccessor$DirectGetter))
DirectPropertyAccessor$DirectGetter.get(Object) line: 58
PojoComponentTuplizer(AbstractComponentTuplizer).getPropertyValue(Object, int) line: 87
ComponentType.getPropertyValue(Object, int, EntityMode) line: 366
PojoEntityTuplizer(AbstractEntityTuplizer).getComponentValue(ComponentType, Object, String) line: 335
PojoEntityTuplizer(AbstractEntityTuplizer).getPropertyValue(Object, String) line: 306
SingleTableEntityPersister(AbstractEntityPersister).getPropertyValue(Object, String, EntityMode) line: 3600
StatefulPersistenceContext.isFoundInParent(String, Object, EntityPersister, CollectionPersister, Object) line: 1186
StatefulPersistenceContext.getOwnerId(String, String, Object, Map) line: 1113
BackrefPropertyAccessor$BackrefGetter.getForInsert(Object, Map, SessionImplementor) line: 139
PojoEntityTuplizer(AbstractEntityTuplizer).getPropertyValuesToInsert(Object, Map, SessionImplementor) line: 287
PojoEntityTuplizer.getPropertyValuesToInsert(Object, Map, SessionImplementor) line: 256
SingleTableEntityPersister(AbstractEntityPersister).getPropertyValuesToInsert(Object, Map, SessionImplementor) line: 3677
DefaultSaveOrUpdateEventListener(AbstractSaveEventListener).performSaveOrReplicate(Object, EntityKey, EntityPersister, boolean, Object, EventSource, boolean) line: 290
DefaultSaveOrUpdateEventListener(AbstractSaveEventListener).performSave(Object, Serializable, EntityPersister, boolean, Object, EventSource, boolean) line: 204
DefaultSaveOrUpdateEventListener(AbstractSaveEventListener).saveWithGeneratedId(Object, String, Object, EventSource, boolean) line: 144
DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(SaveOrUpdateEvent) line: 210
DefaultSaveOrUpdateEventListener.entityIsTransient(SaveOrUpdateEvent) line: 195
DefaultSaveOrUpdateEventListener.performSaveOrUpdate(SaveOrUpdateEvent) line: 117
DefaultSaveOrUpdateEventListener.onSaveOrUpdate(SaveOrUpdateEvent) line: 93
SessionImpl.fireSaveOrUpdate(SaveOrUpdateEvent) line: 535
SessionImpl.saveOrUpdate(String, Object) line: 527
CascadingAction$5.cascade(EventSource, Object, String, Object, boolean) line: 241
Cascade.cascadeToOne(Object, Type, CascadeStyle, Object, boolean) line: 292
Cascade.cascadeAssociation(Object, Type, CascadeStyle, Object, boolean) line: 240
Cascade.cascadeProperty(Object, Type, CascadeStyle, Object, boolean) line: 193
Cascade.cascadeCollectionElements(Object, CollectionType, CascadeStyle, Type, Object, boolean) line: 320
Cascade.cascadeCollection(Object, CascadeStyle, Object, CollectionType) line: 266
Cascade.cascadeAssociation(Object, Type, CascadeStyle, Object, boolean) line: 243
Cascade.cascadeProperty(Object, Type, CascadeStyle, Object, boolean) line: 193
Cascade.cascadeComponent(Object, AbstractComponentType, Object) line: 222
Cascade.cascadeProperty(Object, Type, CascadeStyle, Object, boolean) line: 203
Cascade.cascadeComponent(Object, AbstractComponentType, Object) line: 222
Cascade.cascadeProperty(Object, Type, CascadeStyle, Object, boolean) line: 203
Cascade.cascade(EntityPersister, Object, Object) line: 154
Cascade.cascade(EntityPersister, Object) line: 121
DefaultSaveOrUpdateEventListener.cascadeOnUpdate(SaveOrUpdateEvent, EntityPersister, Object) line: 380
DefaultSaveOrUpdateEventListener.performUpdate(SaveOrUpdateEvent, Object, EntityPersister) line: 352
DefaultSaveOrUpdateEventListener.entityIsDetached(SaveOrUpdateEvent) line: 246
DefaultSaveOrUpdateEventListener.performSaveOrUpdate(SaveOrUpdateEvent) line: 112
DefaultSaveOrUpdateEventListener.onSaveOrUpdate(SaveOrUpdateEvent) line: 93
SessionImpl.fireSaveOrUpdate(SaveOrUpdateEvent) line: 535
SessionImpl.saveOrUpdate(String, Object) line: 527
SessionImpl.saveOrUpdate(Object) line: 523
DaoHibernateBase.saveOrUpdateEntity(Serializable) line: 55
DaoHibernateBase.saveOrUpdateEntity(Object) line: 1
GeneratedMethodAccessor18.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
-------------
Hope it contains enough information to deal with it.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 3 months
[Hibernate-JIRA] Commented: (HHH-879) Enable joining the same association twice with Criteria
by Bernhard Hablesreiter (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-879?page=co... ]
Bernhard Hablesreiter commented on HHH-879:
-------------------------------------------
I came across this issue a while ago and ended up writing a sort of "wrapper" around the criteria, especially the associations.
The problem usually appears when you have some dynamic query builder which adds the association-paths to the criteria more than once.
A simple approach to avoid this problem (and quite easy to implement) could be the following:
- Create a data-structure (this must be some kind of tree) which holds an association path, a list of child-nodes and a list of criterions/order/etc.
- Add your criterions/orders/etc. to the wrapper object
- Create the criteria using your wrapper object:
This method must be recursive. Using this approach you should only create the sub-criterias once (calling criteria.createCriteria(associationPath)) and then add the list of criterions/orders/projections or whatever, coming from the wrapper.
The tree-structure could look like this:
root
+association1
-criterion1
-criterion2
+association2
-criterion1
-criterion2
+subassociation1
-criterion1
-criterion2
This structure is required for fetching associations over multiple hierarchies. Each node can have child-nodes and lists of criterions/orders/etc.
I think this is quite easy to implement and should work in most cases.
> Enable joining the same association twice with Criteria
> -------------------------------------------------------
>
> Key: HHH-879
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-879
> Project: Hibernate Core
> Issue Type: Improvement
> Components: core
> Reporter: Vladimir Bayanov
>
> Make double joining the same association with Criteria.createCriteria possible. See: http://forum.hibernate.org/viewtopic.php?t=931249
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-5046) Cannot nest collections of Embeddable and basic type on an entity
by Christophe LANNOY (JIRA)
Cannot nest collections of Embeddable and basic type on an entity
-----------------------------------------------------------------
Key: HHH-5046
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5046
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Affects Versions: 3.5.0-CR-2
Environment: Hibernate-entity-manager 3.5.0-CR-2, database H2
Reporter: Christophe LANNOY
Attachments: stacktrace, testEmbColl.zip
We cannot nest a String collection on an embeddable element which is inside a collection or a map on an Entity : Entity manager do not start :
Persistence.createEntityManagerFactory("manager1"); give us :
Persistence.createEntityManagerFactory("manager1", configOverrides);
...
Caused by: java.util.ConcurrentModificationException -> see stacktrace file attached
Mapping is :
@javax.persistence.Entity
public class Entity implements Serializable {
...
@ElementCollection
private Map<String, EmbElement> embElements =new HashMap<String, EmbElement>();
... }
@Embeddable
public class EmbElement implements Serializable {
...
@ElementCollection
private Set<String> sstring = new HashSet<String>();
...}
The Zip attached contains the junit class test : EmbededMapTest wich reproduce this error.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-5050) Session factory for statistics mbean cannot be set with dependencies
by Greg V (JIRA)
Session factory for statistics mbean cannot be set with dependencies
--------------------------------------------------------------------
Key: HHH-5050
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5050
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: JBoss 5.1 GA (using JPA)
DBMS: MSSQL 2005
Reporter: Greg V
Priority: Minor
There seems to be an issue with configuring the statistics mbean when not using specific session factories.
Here's the test case I've been using:
1) Configure an ejb-jar to use statistics. jboss-service.xml:
{code}
<mbean code="org.hibernate.jmx.StatisticsService"
name="Hibernate:application=HibernateTest,type=statistics">
<depends>jboss:service=Naming</depends>
<depends>jboss.j2ee:ear=HibernateTest.ear,jar=HibernateTest.jar,name=myManager,service=EJB3</depends>
<attribute name="SessionFactoryJNDIName">hibernateTestSF</attribute>
</mbean>
{code}
2) Enable statistics in persistence.xml and configure the session factory:
{code}
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="HibernateTest" transaction-type="JTA">
<jta-data-source>java:datasources/HibernateTest</jta-data-source>
<properties>
<property name="hibernate.dialect" value="com.c3.hibernate.dialect.SQLServerUnicodeDialect" />
<property name="hibernate.hbm2ddl.auto" value="none" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.generate_statistics" value="true" />
<property name="hibernate.cache.use_second_level_cache" value="true" />
<property name="hibernate.cache.use_query_cache" value="true" />
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.jbc2.JndiMultiplexedJBossCacheRegionFactory" />
<property name="hibernate.cache.region.jbc2.cachefactory" value="java:CacheManager" />
<property name="hibernate.cache.region.jbc2.cfg.entity" value="mvcc-entity" />
<property name="hibernate.cache.region.jbc2.cfg.query" value="local-query" />
<property name="hibernate.cache.region_prefix" value="HibernateTest" />
<property name="hibernate.session_factory_name" value="hibernateTestSF"/>
</properties>
</persistence-unit>
</persistence>
{code}
3) Startup jboss. Despite the dependency on the mbean, it tries to set its session factory jndi name, which results in the following:
{org.hibernate.jmx.StatisticsService} - No session factory with JNDI name hibernateTestSF
Which is normal because the ejb-jar has not been fully deployed yet (although it has started deploying, the session factory from persistence.xml seems to get bound later on according to my server logs). If I don't set the session factory jndi name on the mbean it deploys fine and if I set it after the server has started via the jmx console, all is well. I think there might be an issue either with the dependency or with the setter in the mbean.
If you need a sample maven project or if the test case is not clear enough or the assigned component is not the right one, let me know.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-5049) org.hibernate.test.legacy.ParentChildTest error running testLoadAfterNonExists with Ingres
by Ray Fan (JIRA)
org.hibernate.test.legacy.ParentChildTest error running testLoadAfterNonExists with Ingres
------------------------------------------------------------------------------------------
Key: HHH-5049
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5049
Project: Hibernate Core
Issue Type: Patch
Components: core, testsuite
Affects Versions: 3.5.0-CR-2
Environment: Hibernate 3.5.0-CR-2, Ingres 9.3.1 (int.lnx/106), Ingres9Dialect
Reporter: Ray Fan
Priority: Minor
Error running testLoadAfterNonExists, caused by a lock time out error.
{noformat}
<error message="could not insert: [org.hibernate.test.legacy.Simple]"
type="org.hibernate.exception.GenericJDBCException">
org.hibernate.exception.GenericJDBCException: could not insert: [org.hibernate.test.legacy.Simple]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2438)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2844)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:268)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:260)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:179)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:375)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
at org.hibernate.test.legacy.ParentChildTest.testLoadAfterNonExists(ParentChildTest.java:1061)
Caused by: com.ingres.gcf.util.SqlEx: Timeout occurred on lock request (see SET LOCKMODE command).
at com.ingres.gcf.jdbc.DrvObj.readError(Unknown Source)
at com.ingres.gcf.jdbc.JdbcStmt.readError(Unknown Source)
at com.ingres.gcf.jdbc.DrvObj.readResults(Unknown Source)
at com.ingres.gcf.jdbc.JdbcStmt.readResults(Unknown Source)
at com.ingres.gcf.jdbc.JdbcStmt.readResults(Unknown Source)
at com.ingres.gcf.jdbc.JdbcPrep.exec(Unknown Source)
at com.ingres.gcf.jdbc.JdbcPrep.executeUpdate(Unknown Source)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2418)
... 41 more
</error>
{noformat}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-5027) javax.persistence.lock.timeout ignored by EntityManager#find method
by Adrian Hummel (JIRA)
javax.persistence.lock.timeout ignored by EntityManager#find method
-------------------------------------------------------------------
Key: HHH-5027
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5027
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Affects Versions: 3.5.0-CR-2
Environment: Oracle 10g XE
Reporter: Adrian Hummel
The EntityManager *lock* method does support the {{javax.persistence.lock.timeout}} property whereas the *find* method does not:
Works:
{code}
Map<String, Object> props = new HashMap<String, Object>();
props.put("javax.persistence.lock.timeout", 4000);
em.lock(entity, LockModeType.PESSIMISTIC_WRITE, props); // select ... update wait 4
{code}
Does not work:
{code}
Map<String, Object> props = new HashMap<String, Object>();
props.put("javax.persistence.lock.timeout", 4000);
em.find(MyEntity.class, pk, LockModeType.PESSIMISTIC_WRITE, props); // select ... update
{code}
Note: setting the property by means of the persistence.xml (instead of passing as property map) had no effect in both situations.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 3 months