Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 111820 Details for
Bug 246376
Trac ticket description text is visually obstructed or not drawn correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Trac Wiki Text Entered into the Description field
Failed-Trac-Description.txt (text/plain), 6.33 KB, created by
Jörg Thönnes
on 2008-09-05 10:18:27 EDT
(
hide
)
Description:
Trac Wiki Text Entered into the Description field
Filename:
MIME Type:
Creator:
Jörg Thönnes
Created:
2008-09-05 10:18:27 EDT
Size:
6.33 KB
patch
obsolete
>We have a stateless session bean (StaticDataManagerBean) which offers different >methods for CRUD operations. Also we have several classes annotated with @Entity, >for example SecurityBean and PriceSteapBean. The stateless session bean uses >an injected EntityManager instance. > >{{{ >#!java > @PersistenceContext( unitName="XconnectPersistenceUnit" ) > private EntityManager entityManager; >}}} > >In the first step we want to delete data. This is done by a query: > >{{{ >#!java > public void deletePriceSteps( String exchangeId ) { > Query query = entityManager.createNamedQuery( "deletePriceStepsByExchangeId" ); > query.setParameter( "exchangeId", exchangeId ); > query.executeUpdate(); > entityManager.flush(); > } >}}} > >The query is: "DELETE FROM PriceStepBean p WHERE p.exchangeId = :exchangeId" >This works fine and deletes the expected records in the database. > >After deleting price steps we try to create new price steps: > >{{{ >#!java > public PriceStepBean createPriceStep( PriceStep priceStep ) { > PriceStepBean priceStepBean = new PriceStepBean( priceStep ); > entityManager.persist( priceStepBean ); > return priceStepBean; > } >}}} > >The persist operations fails with an EntityExistsExceptio, see the following stack trace: > >{{{ >[#|2008-09-02T11:09:13.799+0200|INFO|sun-appserver9.1|javax.enterprise.system.container.ejb|_ThreadID=25;_ThreadName=p: >thread-pool-1; w: 10;| >javax.ejb.EJBException > at >com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3869) > at >com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3769) > at >com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3585) > at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1354) > at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1316) > at >com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:205) > at >com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:83) > at $Proxy89.createPriceStep(Unknown Source) > at >com.macd.xConnect.messageprocessor.rule.glox.staticdata.StorePriceStep.storeData(StorePriceStep.java:61) > at >com.macd.xConnect.messageprocessor.rule.glox.staticdata.StoreDataRule.action(StoreDataRule.java:137) > at >com.macd.xConnect.messageprocessor.SequenceRule.apply(SequenceRule.java:73) > at >com.macd.xConnect.messageprocessor.MessageProcessor.processAndRouteMessage(MessageProcessor.java:159) > at >com.macd.xConnect.messageprocessor.MessageProcessor.onMessage(MessageProcessor.java:116) > at >com.macd.xConnect.ejbeans.messageprocessor.MessageProcessorBean.onMessage(MessageProcessorBean.java:100) > at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source) > at >sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at >com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067) > at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176) > at >com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2895) > at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3986) > at >com.sun.ejb.containers.MessageBeanContainer.deliverMessage(MessageBeanContainer.java:1111) > at >com.sun.ejb.containers.MessageBeanListenerImpl.deliverMessage(MessageBeanListenerImpl.java:74) > at >com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:179) > at $Proxy90.onMessage(Unknown Source) > at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:258) > at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:76) > at >com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555) >Caused by: javax.persistence.EntityExistsException: >Exception Description: Cannot persist detached object >[com.macd.xConnect.ejbeans.staticdata.PriceStepBean@529f2b7e]. >Class> com.macd.xConnect.ejbeans.staticdata.PriceStepBean Primary Key> [XVTX, >5000.000000, P1] > at >oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.persist(EntityManagerImpl.java:208) > at >com.sun.enterprise.util.EntityManagerWrapper.persist(EntityManagerWrapper.java:238) > at >com.macd.xConnect.ejbeans.staticdatamanager.StaticDataManagerBean.createPriceStep(StaticDataManagerBean.java:168) > at sun.reflect.GeneratedMethodAccessor104.invoke(Unknown Source) > at >sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at >com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067) > at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176) > at >com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2895) > at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3986) > at >com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:197) > ... 22 more >Caused by: Exception [TOPLINK-7231] (Oracle TopLink Essentials - 2.0.1 (Build >b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.ValidationException >Exception Description: Cannot persist detached object >[com.macd.xConnect.ejbeans.staticdata.PriceStepBean@529f2b7e]. >Class> com.macd.xConnect.ejbeans.staticdata.PriceStepBean Primary Key> [XVTX, >5000.000000, P1] > at >oracle.toplink.essentials.exceptions.ValidationException.cannotPersistExistingObject(ValidationException.java:2171) > at >oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerNotRegisteredNewObjectForPersist(UnitOfWorkImpl.java:3251) > at >oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.registerNotRegisteredNewObjectForPersist(RepeatableWriteUnitOfWork.java:339) > at >oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:3220) > at >oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.persist(EntityManagerImpl.java:205) > ... 32 more >|#] >}}}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 246376
: 111820 |
112179
|
112180
|
112181
|
112182
|
112183
|
112184
|
112185
|
115346
|
115347
|
115348