Details

    • Type: Question Question
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.1
    • Fix Version/s: None
    • Component/s: jpa
    • Labels:
    • Environment:
      Windows XP, Weblogic 11g, openjpa-1.2.1.jar, EJB 3.0, DB2, Java 1.6.0_13, MyEclipse Enterprise Workbench Version: 8.0

      Description

      From webapp, submitting a NEW record to the database causes the JPA object to not correctly rollback in the database and throws a openjpa-1.1.1-SNAPSHOT error (currently using openjpa-1.2.1.jar).

      Why does the console print 1.1.1 for the openjpa when the project needs to be using .1.2.1 openjpa??

      The openjpa-1.2.1.jar is located in the Referenced Libraries folder of the project.
      The below persistence.xml has been modifed a few times with and without the Connection* property entries all with the same failures. The project was migrated from Websphere and is not suppose to run on WebLogic. It is possible that that 1.2.1 openjpa jars are not being used by WebLogic and that this might be configuration.

      ===== persistence.xml

      <?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="NRPPU" transaction-type="JTA">
      <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
      <jta-data-source>jdbc/NrpJtaDS</jta-data-source>
      <properties>
      <property name="openjpa.TransactionMode" value="managed"/>
      <property name="openjpa.ConnectionFactoryMode" value="managed"/>
      <property name="openjpa.jdbc.DBDictionary" value="db2"/>
      <property name="openjpa.DetachState" value="all(DetachedStateField=true)" />
      <property name="openjpa.ConnectionURL" value="jdbc:db2://XXX.xxx.XXX.212:60004/XXXXXDB"/>
      <property name="openjpa.ConnectionDriverName" value="com.ibm.db2.jcc.DB2Driver"/>
      <property name="openjpa.ConnectionUserName" value="XXXXX"/>
      <property name="openjpa.ConnectionPassword" value="XXXXXX"/>
      <property name="openjpa.jdbc.Schema" value="XXXDATA"/>
      <!--
      <property name="openjpa.Log" value="SQL=TRACE"/>
      -->
      <property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO, MetaData=INFO, Enhance=INFO, Schema=INFO, Runtime=INFO, Query=INFO, JDBC=INFO"/>
      </properties>
      </persistence-unit>
      </persistence>

      ====== Error from Console

      SEVERE: <openjpa-1.1.1-SNAPSHOT-r422266:807362 fatal user error> org.apache.openjpa.persistence.InvalidStateException: Attempt to set column "COM_PERSON.PERSON_DISCRIMINATOR" to two different values: (class java.lang.String)"", (class java.lang.String)"COM_AGENT" This can occur when you fail to set both sides of a two-sided relation between objects, or when you map different fields to the same column, but you do not keep the values of these fields in synch.
      javax.faces.el.EvaluationException: <openjpa-1.1.1-SNAPSHOT-r422266:807362 fatal user error> org.apache.openjpa.persistence.InvalidStateException: Attempt to set column "COM_PERSON.PERSON_DISCRIMINATOR" to two different values: (class java.lang.String)"", (class java.lang.String)"COM_AGENT" This can occur when you fail to set both sides of a two-sided relation between objects, or when you map different fields to the same column, but you do not keep the values of these fields in synch.
      at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:97)
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
      at us.tx.state.txdps.nrp.common.listener.ExceptionActionListener.processAction(ExceptionActionListener.java:15)
      at javax.faces.component.UICommand.broadcast(UICommand.java:383)
      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:450)
      at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:759)
      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:18)
      at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:122)
      at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:73)
      at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:28)
      at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
      at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:160)
      at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$1.service(SessionDispatcher.java:42)
      at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
      at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
      at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:62)
      at com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:22)
      at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
      at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:153)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
      Caused by: <openjpa-1.1.1-SNAPSHOT-r422266:807362 fatal user error> org.apache.openjpa.persistence.InvalidStateException: Attempt to set column "COM_PERSON.PERSON_DISCRIMINATOR" to two different values: (class java.lang.String)"", (class java.lang.String)"COM_AGENT" This can occur when you fail to set both sides of a two-sided relation between objects, or when you map different fields to the same column, but you do not keep the values of these fields in synch.
      at org.apache.openjpa.jdbc.sql.PrimaryRow.setObject(PrimaryRow.java:339)
      at org.apache.openjpa.jdbc.sql.RowImpl.setObject(RowImpl.java:504)
      at org.apache.openjpa.jdbc.meta.strats.InValueDiscriminatorStrategy.insert(InValueDiscriminatorStrategy.java:98)
      at org.apache.openjpa.jdbc.meta.Discriminator.insert(Discriminator.java:343)
      at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.insert(AbstractUpdateManager.java:212)
      at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.insert(AbstractUpdateManager.java:196)
      at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.populateRowManager(AbstractUpdateManager.java:145)
      at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:85)
      at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
      at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:549)
      at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
      at org.apache.openjpa.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:554)
      at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
      at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2017)
      at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1915)
      at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1686)
      at org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:989)
      at org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:592)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:93)
      at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:91)
      at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:80)
      at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:26)
      at $Proxy79.flush(Unknown Source)
      at us.tx.state.txdps.nrp.persistence.jpa.dao.AnlAnalystReviewDaoBase.flush(AnlAnalystReviewDaoBase.java:61)
      at us.tx.state.txdps.nrp.ejb.analysis.AnalystReviewEjb.createAnalystReview(AnalystReviewEjb.java:212)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
      at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      at com.bea.core.repackaged.springframework.jee.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:104)
      at us.tx.state.txdps.nrp.ejb.interceptor.LoggingInterceptor.queryResponseTimer(LoggingInterceptor.java:63)
      at sun.reflect.GeneratedMethodAccessor403.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
      at com.bea.core.repackaged.springframework.jee.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:69)
      at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
      at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:55)
      at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
      at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
      at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      at $Proxy200.createAnalystReview(Unknown Source)
      at us.tx.state.txdps.nrp.ejb.analysis.AnalystReviewEjb_20kbwm_AnalystReviewEjbRemoteImpl.createAnalystReview(AnalystReviewEjb_20kbwm_AnalystReviewEjbRemoteImpl.java:67)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:73)
      at $Proxy89.createAnalystReview(Unknown Source)
      at us.tx.state.txdps.nrp.analysis.backing.AnalystReviewBacking.saveAnalystReview(AnalystReviewBacking.java:500)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
      at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
      at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
      at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
      ... 38 more
      Mar 19, 2010 2:46:18 PM us.tx.state.txdps.nrp.common.ejb.EjbLookupFactory lookupJndi
      INFO: EJB Lookup Succeeded for: BatchEjb#us.tx.state.txdps.batch.ejb.BatchEjbRemote
      Mar 19, 2010 2:46:18 PM us.tx.state.txdps.nrp.common.ejb.EjbLookupFactory lookupJndi
      INFO: EJB Lookup Succeeded for: BatchEjb#us.tx.state.txdps.batch.ejb.BatchEjbRemote
      Mar 19, 2010 2:46:18 PM us.tx.state.txdps.batch.manager.MessageManager info
      INFO: AUTOMATIC.JobHistoryCleanup - Found 0 scheduled jobs.
      Mar 19, 2010 2:46:18 PM us.tx.state.txdps.batch.manager.MessageManager info
      INFO: AUTOMATIC.JobScheduler - Found 0 queued jobs.
      Mar 19, 2010 2:46:18 PM us.tx.state.txdps.batch.manager.MessageManager info
      INFO: AUTOMATIC.JobHistoryCleanup - Found 0 executing jobs.

      1. WLS_Persistence.jpg
        38 kB
        Aaron White
      2. ComPerson.java
        13 kB
        Aaron White
      3. ComAgent.java
        2 kB
        Aaron White

        Activity

        Hide
        Fay Wang added a comment -

        Can you provide your entity definitions?

        Show
        Fay Wang added a comment - Can you provide your entity definitions?
        Hide
        Aaron White added a comment - - edited

        I'm not sure what you mean by "entity definitions"? Please explain what you mean.

        Show
        Aaron White added a comment - - edited I'm not sure what you mean by "entity definitions"? Please explain what you mean.
        Hide
        Fay Wang added a comment -

        From the stack trace, it seems that you have Person entity., Can you post your Person entity, Agent entity and other related entities? Or can you post your application?

        Show
        Fay Wang added a comment - From the stack trace, it seems that you have Person entity., Can you post your Person entity, Agent entity and other related entities? Or can you post your application?
        Hide
        Aaron White added a comment - - edited

        I've attached the ComPerson and ComAgent java class file. Please let me know if you need anything else. Thanks.

        Show
        Aaron White added a comment - - edited I've attached the ComPerson and ComAgent java class file. Please let me know if you need anything else. Thanks.
        Hide
        Michael Dick added a comment -

        Hi Aaron,

        IIRC WebLogic ships with OpenJPA 1.1.1. If you intend to use OpenJPA 1.2.x you may want to look into the WLS configuration for third-party persistence providers. The error message indicates it's pulling in an older version.

        Show
        Michael Dick added a comment - Hi Aaron, IIRC WebLogic ships with OpenJPA 1.1.1. If you intend to use OpenJPA 1.2.x you may want to look into the WLS configuration for third-party persistence providers. The error message indicates it's pulling in an older version.
        Hide
        Aaron White added a comment - - edited

        Michael,

        Currently I show org.apache.openjpa.persistence.PersistenceProviderImpl for the Provider (Path: Deployments\ProjectName\Summary of Deployments\ProjectName) Configuration Tab->Persistence Tab...

        There is not an option to explicitly set the version of OpenJPA in the WLS is there? See Screenshot

        Also, does it matter if I use:
        <persistence-unit name="NRPPU" transaction-type="RESOURCE_LOCAL">
        vs
        <persistence-unit name="NRPPU" transaction-type="JTA">

        Would the above (from persistence.xml) matter if I want to use Referenced Library openjpa-1.2.1.jar and not the native 1.1.1 jar that comes with WL?

        Show
        Aaron White added a comment - - edited Michael, Currently I show org.apache.openjpa.persistence.PersistenceProviderImpl for the Provider (Path: Deployments\ProjectName\Summary of Deployments\ProjectName) Configuration Tab->Persistence Tab... There is not an option to explicitly set the version of OpenJPA in the WLS is there? See Screenshot Also, does it matter if I use: <persistence-unit name="NRPPU" transaction-type="RESOURCE_LOCAL"> vs <persistence-unit name="NRPPU" transaction-type="JTA"> Would the above (from persistence.xml) matter if I want to use Referenced Library openjpa-1.2.1.jar and not the native 1.1.1 jar that comes with WL?
        Hide
        Aaron White added a comment -

        Screenshot from WLS/Persistence tab, looking for a way to set a specific version of OpenJPA and not allow WL to use the default 1.1.1 OpenJPA...

        Show
        Aaron White added a comment - Screenshot from WLS/Persistence tab, looking for a way to set a specific version of OpenJPA and not allow WL to use the default 1.1.1 OpenJPA...
        Hide
        Michael Dick added a comment -

        I can't comment on how you'd set the version in WLS - I've never used it. Some other folks here might know how but failing that it might be a question for WLS support.

        The persistence.xml file will work with either version of OpenJPA . There might be other parts of your application which rely on OpenJPA 1.2.1 though. Did the app 'just work' with 1.2.1?

        Show
        Michael Dick added a comment - I can't comment on how you'd set the version in WLS - I've never used it. Some other folks here might know how but failing that it might be a question for WLS support. The persistence.xml file will work with either version of OpenJPA . There might be other parts of your application which rely on OpenJPA 1.2.1 though. Did the app 'just work' with 1.2.1?
        Hide
        Aaron White added a comment -

        We're in the process of migrating from WebSphere to WebLogic 11g and we didn't have this issue on WebSphere. I found a file in C:\Oracle\Middleware\modules called org.apache.openjpa_1.0.1.0_1-1-1-SNAPSHOT.jar, which I am guessing is the default jar file for OpenJPA used by WebLogic. No matter what I change, or set I keep getting error messages like the one above referencing version 1.1.1 of the OpenJPA. Other than WLS support how else can I ask these questions in this forum? I'd like to see if anyone from the Apache knowledge group has ever encountered this issue.. Any help would be very very appreciated...

        Show
        Aaron White added a comment - We're in the process of migrating from WebSphere to WebLogic 11g and we didn't have this issue on WebSphere. I found a file in C:\Oracle\Middleware\modules called org.apache.openjpa_1.0.1.0_1-1-1-SNAPSHOT.jar, which I am guessing is the default jar file for OpenJPA used by WebLogic. No matter what I change, or set I keep getting error messages like the one above referencing version 1.1.1 of the OpenJPA. Other than WLS support how else can I ask these questions in this forum? I'd like to see if anyone from the Apache knowledge group has ever encountered this issue.. Any help would be very very appreciated...
        Hide
        Ravi P Palacherla added a comment -

        Can you please explain how you configured openjpa-1.2.1.jar inside weblogic ?
        Are you using filtering classloader ?
        Please check the following documentation for filtering classloader.
        http://download.oracle.com/docs/cd/E12839_01/web.1111/e13706/classloading.htm#WLPRG313

        Show
        Ravi P Palacherla added a comment - Can you please explain how you configured openjpa-1.2.1.jar inside weblogic ? Are you using filtering classloader ? Please check the following documentation for filtering classloader. http://download.oracle.com/docs/cd/E12839_01/web.1111/e13706/classloading.htm#WLPRG313
        Hide
        Fay Wang added a comment -

        It is found that in your ComPerson.java, you have

        @Column(name = "PERSON_DISCRIMINATOR", unique = false, nullable = false, insertable = true, updatable = true, length = 50)
        public String getPersonDiscriminator()

        { return this.personDiscriminator; }

        public void setPersonDiscriminator(String personDiscriminator)

        { this.personDiscriminator = personDiscriminator; }

        and your ComPerson is annotated as:
        @Entity
        @Inheritance (strategy=InheritanceType.JOINED)
        @DiscriminatorColumn (discriminatorType=DiscriminatorType.STRING, name="PERSON_DISCRIMINATOR", length=50)
        @DiscriminatorValue("COM_PERSON")
        @Table(name = "COM_PERSON", schema = "NRPDATA", uniqueConstraints = {})
        public class ComPerson implements Serializable {

        I reproduced your problem by doing the following:
        public void testCreate()

        { EntityManager em = emf.createEntityManager(); ComPerson p = new ComPerson(); p.setAuditHistory("auditHistory"); p.setBirthDtEstFlag("D"); p.setCreatedUserId((long)1); p.setCreatedTs(new java.util.Date()); p.setUpdatedUserId((long)1); p.setUpdatedTs(new java.util.Date()); p.setDeletedFlag("1"); p.setPersonDiscriminator(""); em.persist(p); em.getTransaction().begin(); em.getTransaction().commit(); em.clear(); }

        Normally, you don't need to have get/setPersonDiscriminator methods. OpenJPA will automatically
        supply the discriminator value. Please let me know if this is the case.

        <openjpa-0.0.0-rnull fatal store error> org.apache.openjpa.persistence.RollbackException: The transaction has been rolled back. See the nested exceptions for details on the errors that occurred.
        at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:573)
        at oj1587.Test1587.testCreate(Test1587.java:54)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at junit.framework.TestCase.runTest(Unknown Source)
        at junit.framework.TestCase.runBare(Unknown Source)
        at junit.framework.TestResult$1.protect(Unknown Source)
        at junit.framework.TestResult.runProtected(Unknown Source)
        at junit.framework.TestResult.run(Unknown Source)
        at junit.framework.TestCase.run(Unknown Source)
        at junit.framework.TestSuite.runTest(Unknown Source)
        at junit.framework.TestSuite.run(Unknown Source)
        at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
        Caused by: <openjpa-0.0.0-rnull fatal general error> org.apache.openjpa.persistence.PersistenceException: The transaction has been rolled back. See the nested exceptions for details on the errors that occurred.
        at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2279)
        at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2123)
        at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2020)
        at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1938)
        at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
        at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1462)
        at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:924)
        at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:556)
        ... 20 more
        Caused by: <openjpa-0.0.0-rnull fatal user error> org.apache.openjpa.persistence.InvalidStateException: Attempt to set column "COM_PERSON.PERSON_DISCRIMINATOR" to two different values: (class java.lang.String)"", (class java.lang.String)"COM_PERSON" This can occur when you fail to set both sides of a two-sided relation between objects, or when you map different fields to the same column, but you do not keep the values of these fields in synch.
        at org.apache.openjpa.jdbc.sql.PrimaryRow.setObject(PrimaryRow.java:344)
        at org.apache.openjpa.jdbc.sql.RowImpl.setObject(RowImpl.java:510)
        at org.apache.openjpa.jdbc.meta.strats.InValueDiscriminatorStrategy.insert(InValueDiscriminatorStrategy.java:102)
        at org.apache.openjpa.jdbc.meta.Discriminator.insert(Discriminator.java:343)
        at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.insert(AbstractUpdateManager.java:239)
        at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.populateRowManager(AbstractUpdateManager.java:162)
        at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:95)
        at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:76)
        at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:717)
        at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
        ... 27 more

        Show
        Fay Wang added a comment - It is found that in your ComPerson.java, you have @Column(name = "PERSON_DISCRIMINATOR", unique = false, nullable = false, insertable = true, updatable = true, length = 50) public String getPersonDiscriminator() { return this.personDiscriminator; } public void setPersonDiscriminator(String personDiscriminator) { this.personDiscriminator = personDiscriminator; } and your ComPerson is annotated as: @Entity @Inheritance (strategy=InheritanceType.JOINED) @DiscriminatorColumn (discriminatorType=DiscriminatorType.STRING, name="PERSON_DISCRIMINATOR", length=50) @DiscriminatorValue("COM_PERSON") @Table(name = "COM_PERSON", schema = "NRPDATA", uniqueConstraints = {}) public class ComPerson implements Serializable { I reproduced your problem by doing the following: public void testCreate() { EntityManager em = emf.createEntityManager(); ComPerson p = new ComPerson(); p.setAuditHistory("auditHistory"); p.setBirthDtEstFlag("D"); p.setCreatedUserId((long)1); p.setCreatedTs(new java.util.Date()); p.setUpdatedUserId((long)1); p.setUpdatedTs(new java.util.Date()); p.setDeletedFlag("1"); p.setPersonDiscriminator(""); em.persist(p); em.getTransaction().begin(); em.getTransaction().commit(); em.clear(); } Normally, you don't need to have get/setPersonDiscriminator methods. OpenJPA will automatically supply the discriminator value. Please let me know if this is the case. <openjpa-0.0.0-rnull fatal store error> org.apache.openjpa.persistence.RollbackException: The transaction has been rolled back. See the nested exceptions for details on the errors that occurred. at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:573) at oj1587.Test1587.testCreate(Test1587.java:54) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(Unknown Source) at junit.framework.TestCase.runBare(Unknown Source) at junit.framework.TestResult$1.protect(Unknown Source) at junit.framework.TestResult.runProtected(Unknown Source) at junit.framework.TestResult.run(Unknown Source) at junit.framework.TestCase.run(Unknown Source) at junit.framework.TestSuite.runTest(Unknown Source) at junit.framework.TestSuite.run(Unknown Source) at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: <openjpa-0.0.0-rnull fatal general error> org.apache.openjpa.persistence.PersistenceException: The transaction has been rolled back. See the nested exceptions for details on the errors that occurred. at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2279) at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2123) at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2020) at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1938) at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81) at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1462) at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:924) at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:556) ... 20 more Caused by: <openjpa-0.0.0-rnull fatal user error> org.apache.openjpa.persistence.InvalidStateException: Attempt to set column "COM_PERSON.PERSON_DISCRIMINATOR" to two different values: (class java.lang.String)"", (class java.lang.String)"COM_PERSON" This can occur when you fail to set both sides of a two-sided relation between objects, or when you map different fields to the same column, but you do not keep the values of these fields in synch. at org.apache.openjpa.jdbc.sql.PrimaryRow.setObject(PrimaryRow.java:344) at org.apache.openjpa.jdbc.sql.RowImpl.setObject(RowImpl.java:510) at org.apache.openjpa.jdbc.meta.strats.InValueDiscriminatorStrategy.insert(InValueDiscriminatorStrategy.java:102) at org.apache.openjpa.jdbc.meta.Discriminator.insert(Discriminator.java:343) at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.insert(AbstractUpdateManager.java:239) at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.populateRowManager(AbstractUpdateManager.java:162) at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:95) at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:76) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:717) at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130) ... 27 more
        Hide
        Ravi P Palacherla added a comment -

        >> For your question about using different openJPA version other than the one shipped with weblogic.
        http://download.oracle.com/docs/cd/E15523_01/web.1111/e13720/using_kodo.htm#BJFBBEHD has clear instructions on what needs to be done.

        Show
        Ravi P Palacherla added a comment - >> For your question about using different openJPA version other than the one shipped with weblogic. http://download.oracle.com/docs/cd/E15523_01/web.1111/e13720/using_kodo.htm#BJFBBEHD has clear instructions on what needs to be done.

          People

          • Assignee:
            Unassigned
            Reporter:
            Aaron White
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development