tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BKumar <bibhuti.ku...@creditpointe.com>
Subject Optimi sticLockException: Optimistic locking errors were detected when flushing to the data store
Date Tue, 22 Jan 2013 07:08:55 GMT
Hi All,

This is related to CMP2.1 on tomee+.

I am  getting Optimisticlockexception. When calling remove for both child
and parent.

1. I am getting below exception when I call  remove on both
"RuleConditionBean"(Child) and "RuleBean"(parent).
2. I  don't get exception when I all remove only on RuleBean(Parent).

As I  want to follow the first way only because don't want to change my 
existing code.

openejb-orm.xml:

<entity class="openejb.com.rage.rule.dal.ejb.RuleBean" name="RuleBean">
		<description>Rule#RuleBean</description>
		

	
		<named-query
			name="RuleBean.findByRuleNameAppId(java.lang.String,java.lang.Integer)">
			<query>SELECT OBJECT(r) FROM RuleBean AS r WHERE (r.rule_Name = ?1 AND
r.appl_Seq_Id = ?2)</query>
		</named-query>
		
		<attributes>
			<id name="rule_Seq_Id">
				<column name="RULE_SEQ_ID" />
				<generated-value strategy="TABLE" generator="RD_SEQUENCE" />
			</id>
			<basic name="appl_Seq_Id">
				<column name="APPL_SEQ_ID" />
			</basic>
			<basic name="rule_Name">
				<column name="RULE_NAME" />
			</basic>
			
			<one-to-many mapped-by="rule" name="ruleConditions">
				<cascade>
				<cascade-All/>
				</cascade>
			</one-to-many>
		</attributes>
	</entity>
	<entity class="openejb.com.rage.rule.dal.ejb.RuleConditionBean"
		name="RuleConditionBean">
		<description>Rule#RuleConditionBean</description>
		

		<id-class class="com.rage.rule.dal.ejb.RuleConditionPK" />
		<named-query name="RuleConditionBean.findByRuleKey(java.lang.Integer)">
			<query>SELECT OBJECT(r) FROM RuleConditionBean AS r WHERE r.rule_Seq_Id =
?1</query>
		</named-query>
		<attributes>
			<id  name="rule_Seq_Id">
				<column  updatable="false" name="RULE_SEQ_ID" />
			</id>
			<id name="cond_Paramseq_No">
				<column updatable="false"  name="COND_PARAMSEQ_NO" />
			</id>
			
			<basic name="cond_Lhs">
				<column name="COND_LHS" />
			</basic>
			
			<many-to-one optional="true" name="rule">
				<join-column  nullable="false" name="RULE_SEQ_ID" />
				
			</many-to-one>
		</attributes>
	</entity>
-----------------------------------------------------------------------------

WARNING: Unexpected exception from beforeCompletion; transaction will roll
back
<openjpa-2.2.0-r422266:1244990 nonfatal store error>
org.apache.openjpa.persistence.Optimi
sticLockException: Optimistic locking errors were detected when flushing to
the data store
.  The following objects may have been concurrently modified in another
transaction: [open
ejb.com.rage.rule.dal.ejb.RuleConditionBean-Rule Condition: Id =
15285Sequence No. = 1]
        at
org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2326)
        at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2174)
        at
org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2072)
        at
org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1990)
        at
org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(Transa
ctionImpl.java:527)
        at
org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(Transa
ctionImpl.java:512)
        at
org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(Transacti
onImpl.java:413)
        at
org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.
java:262)
        at
org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(Transacti
onManagerImpl.java:252)
        at
org.apache.openejb.core.transaction.JtaTransactionPolicy.completeTransaction(Jt
aTransactionPolicy.java:328)
        at
org.apache.openejb.core.transaction.TxRequired.commit(TxRequired.java:75)
        at
org.apache.openejb.core.transaction.EjbTransactionUtil.afterInvoke(EjbTransacti
onUtil.java:73)
        at
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer
.java:257)
        at
org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.
java:189)
        at
org.apache.openejb.core.ivm.EjbObjectProxyHandler.synchronizedBusinessMethod(Ej
bObjectProxyHandler.java:253)
        at
org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxy
Handler.java:248)
        at
org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler
.java:92)
        at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java
:279)
        at $Proxy139.delete(Unknown Source)
        at com.rage.rule.bizcomp.RuleHandler.service(RuleHandler.java:120)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil
terChain.java:305)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain
.java:210)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
222)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
123)
        at
org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.ja
va:472)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:11
8)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processo
r.java:1004)
        at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractPr
otocol.java:589)
        at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310
)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:
886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)




--
View this message in context: http://openejb.979440.n4.nabble.com/Optimi-sticLockException-Optimistic-locking-errors-were-detected-when-flushing-to-the-data-store-tp4660338.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message