1 Reply Latest reply on Aug 29, 2011 10:17 AM by RupakKhurana

    DB commit causing CORBA exception

    RupakKhurana

      Hello,

      I am using the following code to make an entry into the database :-

       

               DataServiceTransaction dtx = DataServiceTransaction.begin(true); 
               dtx.setSendChangesToAdapter(true);
               Currency c1 = new Currency();
               c1.setCurrencyCode("ABC");
               c1.setCurrencyName("Dummy Currency");
               c1.setCurrencyLastUpdated(new Date());
               c1.setCurrencyId(new Integer(1)); 
               dtx.createItem("TraderWorkStation.Currency", c1); 
               dtx.commit();

       

      The model has the following DMS annotations, while the entry is being created but there is a CORBA exception as shown below, pls advise

       

      <

       

      annotation name="DMS">

       

       

      <item name="datasource">java:comp/env/ALGODB</item>

       

       

      <item name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</item>

       

       

      <item name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JOTMTransactionManagerLookup</item>

       

       

      <item name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</item>

       

      <item name="ServerGeneratedEntities">false</item>

       

       

      </annotation>

       

       

       

      [TWSServer]08/29/2011 12:40:14.159 [DEBUG] [Service.Data.Transaction] Started transaction using jndi name: java:comp/UserTransaction
      [TWSServer]08/29/2011 12:40:14.159 [DEBUG] [Service.Data.Transaction] Sending server message to adapter: Flex Message (flex.data.messages.DataMessage)
          operation = create
          id = {currencyId=1}
          clientId = srv:480E9B77-C609-9091-D39B-DBF64632AEFA
          correlationId = null
          destination = TraderWorkStation.Currency
          messageId = srv:480E9B77-C609-9091-D39B-DBF64632AEFA:7
          timestamp = 1314636014159
          timeToLive = 0
          body = TraderWorkStation.Currency@20
      [TWSServer]08/29/2011 12:40:14.160 [DEBUG] [Service.Data.General] Before TraderWorkStation.Currency.createItem (
          (TraderWorkStation.Currency) {currencyId=1} (23000154) {
              currencyName = Dummy Currency
              currencyCode = ABC
              currencyId = 1
              currencyLastUpdated = Mon Aug 29 12:40:14 EDT 2011
          })

      In createItem() item =TraderWorkStation.Currency@20
      [TWSServer]08/29/2011 12:40:14.166 [DEBUG] [Service.Data.General] After TraderWorkStation.Currency.createItem (
          (TraderWorkStation.Currency) {currencyId=255} (23000154) {
              currencyName = Dummy Currency
              currencyCode = ABC
              currencyId = 255
              currencyLastUpdated = Mon Aug 29 12:40:14 EDT 2011
          })
      [TWSServer]08/29/2011 12:40:14.166 [DEBUG] [Message.Timing] After invoke service: data-service; execution time = 7ms
      [TWSServer]08/29/2011 12:40:14.167 [ERROR] [Service.Data.Transaction] Error while committing transaction: org.omg.CORBA.BAD_INV_ORDER: The Servant has not been associated with an ORB instance  vmcid: 0x0  minor code: 0  completed: No stack=org.omg.CORBA.BAD_INV_ORDER: The Servant has not been associated with an ORB instance  vmcid: 0x0  minor code: 0  completed: No
              at org.omg.PortableServer.Servant._get_delegate(Servant.java:35)
              at org.omg.PortableServer.Servant._poa(Servant.java:99)
              at org.objectweb.jotm._SubCoordinator_Tie.deactivate(Unknown Source)
              at com.sun.corba.se.impl.javax.rmi.CORBA.Util.cleanUpTie(Util.java:512)
              at com.sun.corba.se.impl.javax.rmi.CORBA.Util.unexportObject(Util.java:489)
              at javax.rmi.CORBA.Util.unexportObject(Util.java:161)
              at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.unexportObject(PortableRemoteObject. java:173)
              at javax.rmi.PortableRemoteObject.unexportObject(PortableRemoteObject.java:119)
              at org.objectweb.jotm.TransactionImpl.cleanup(TransactionImpl.java:1167)
              at org.objectweb.jotm.Current.forgetTx(Current.java:1035)
              at org.objectweb.jotm.SubCoordinator.doAfterCompletion(SubCoordinator.java:1635)
              at org.objectweb.jotm.SubCoordinator.commit_one_phase(SubCoordinator.java:486)
              at org.objectweb.jotm.TransactionImpl.commit(TransactionImpl.java:318)
              at org.objectweb.jotm.Current.commit(Current.java:452)
              at flex.data.DataServiceTransaction.doCommit(DataServiceTransaction.java:1421)
              at flex.data.DataServiceTransaction.commit(DataServiceTransaction.java:366)
              at com.kuberre.hansa.twsserver.control.HansaApiMgr.fetchAllData(HansaApiMgr.java:46)
              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 flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:418)
              at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
              at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1400)
              at flex.messaging.AsyncMessageBroker.filteredRouteMessageToService(AsyncMessageBroker.java:5 76)
              at flex.messaging.filters.SyncMessageFilterChain$MessageFilterContext.filterRequest(SyncMess ageFilterChain.java:220)
              at flex.messaging.services.SyncReliableMessagingFilter.filterRequest(SyncReliableMessagingFi lter.java:206)
              at flex.messaging.filters.SyncMessageFilterChain$MessageFilterContext.filterRequest(SyncMess ageFilterChain.java:216)
              at flex.messaging.filters.SyncMessageFilterChain$MessageFilterContext.processRequest(SyncMes sageFilterChain.java:202)
              at flex.messaging.filters.SyncMessageFilterChain.filterRequest(SyncMessageFilterChain.java:1 40)
              at flex.messaging.AsyncMessageBroker.routeMessageToService(AsyncMessageBroker.java:564)
              at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005)
              at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
              at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
              at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
              at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
              at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:166)
              at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
              at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:353)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:304)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
              at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:851)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:278)
              at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.jav a:515)
              at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:619)