1 Reply Latest reply on Nov 22, 2005 3:11 PM by Tiago Gaspar

    Unable to commit error

    Tiago Gaspar Newbie

      Hello,
      I'm having a hard time to commit a transaction that changes a simple field in my Entity Bean. The funny part is that it happens only with this particular field. I've tested with other fields of the same EJB (all plain CMP Fields) and it works fine. I can read it o'right, but when I try to change it, I get this at the end of the method :

      2005-11-19 18:19:51,751 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.MovExBean] Executing SQL: UPDATE MOV_EX SET exame_digitado=? WHERE ordem_movex=? AND codigo_pedido=? AND posto_pedido=?
      2005-11-19 18:19:51,751 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.MovExBean#exameDigitado] param: i=1, type=VARCHAR, value=L
      2005-11-19 18:19:51,751 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.MovExBean#ordemMovex] param: i=2, type=INTEGER, value=1
      2005-11-19 18:19:51,751 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.MovExBean#codigoPedido] param: i=3, type=INTEGER, value=46500
      2005-11-19 18:19:51,751 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.MovExBean#postoPedido] param: i=4, type=VARCHAR, value=02
      2005-11-19 18:19:53,052 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
      2005-11-19 18:19:53,052 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
      2005-11-19 18:19:53,052 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
      2005-11-19 18:19:53,052 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackException in method: public abstract void br.com.labgaspar.session.StatusExameSRemoteBusiness.modifica(java.lang.Integer,java.lang.String,java.lang.Integer,java.lang.String,java.lang.String) throws java.rmi.RemoteException,javax.ejb.FinderException, causedBy:
      org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=tiago/21, BranchQual=, localId=21] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0, id=br.com.labgaspar.entities.MovExPK@b3a7)
      at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:344)
      at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:486)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:346)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      at org.jboss.ejb.Container.invoke(Container.java:873)
      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:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
      at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
      at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
      at $Proxy283.modifica(Unknown Source)
      at org.apache.jsp.LiberaPedido_jsp._jspService(org.apache.jsp.LiberaPedido_jsp:144)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0, id=br.com.labgaspar.entities.MovExPK@b3a7
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.execute(JDBCStoreEntityCommand.java:155)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.storeEntity(JDBCStoreManager.java:651)
      at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenceManager.java:413)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:390)
      at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:743)
      at org.jboss.ejb.GlobalTxEntityMap$2.synchronize(GlobalTxEntityMap.java:134)
      at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.synchronize(GlobalTxEntityMap.java:253)
      at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.beforeCompletion(GlobalTxEntityMap.java:302)
      at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1384)
      at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1076)
      at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:296)
      ... 52 more
      2005-11-19 18:19:53,062 INFO [STDOUT] org.jboss.tm.JBossTransactionRolledbackException: null; nested exception is:
      org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=tiago/21, BranchQual=, localId=21] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0, id=br.com.labgaspar.entities.MovExPK@b3a7); - nested throwable: (org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=tiago/21, BranchQual=, localId=21] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0, id=br.com.labgaspar.entities.MovExPK@b3a7))
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.throwJBossException(TxInterceptorCMT.java:554)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:491)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:346)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.ejb.Container.invoke(Container.java:873)
      2005-11-19 18:19:53,062 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2005-11-19 18:19:53,062 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      2005-11-19 18:19:53,062 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      2005-11-19 18:19:53,062 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
      2005-11-19 18:19:53,062 INFO [STDOUT] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
      2005-11-19 18:19:53,072 INFO [STDOUT] at $Proxy283.modifica(Unknown Source)
      2005-11-19 18:19:53,072 INFO [STDOUT] at org.apache.jsp.LiberaPedido_jsp._jspService(org.apache.jsp.LiberaPedido_jsp:144)
      2005-11-19 18:19:53,072 INFO [STDOUT] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      2005-11-19 18:19:53,072 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      2005-11-19 18:19:53,072 INFO [STDOUT] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
      2005-11-19 18:19:53,072 INFO [STDOUT] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      2005-11-19 18:19:53,072 INFO [STDOUT] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      2005-11-19 18:19:53,072 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      2005-11-19 18:19:53,072 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      2005-11-19 18:19:53,082 INFO [STDOUT] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      2005-11-19 18:19:53,082 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
      2005-11-19 18:19:53,082 INFO [STDOUT] Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=tiago/21, BranchQual=, localId=21] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0, id=br.com.labgaspar.entities.MovExPK@b3a7)
      2005-11-19 18:19:53,112 INFO [STDOUT] at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:344)
      2005-11-19 18:19:53,112 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:486)
      2005-11-19 18:19:53,163 INFO [STDOUT] ... 51 more
      2005-11-19 18:19:53,163 INFO [STDOUT] Caused by: javax.ejb.EJBException: Update failed. Expected one affected row: rowsAffected=0, id=br.com.labgaspar.entities.MovExPK@b3a7
      2005-11-19 18:19:53,163 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.execute(JDBCStoreEntityCommand.java:155)
      2005-11-19 18:19:53,163 INFO [STDOUT] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.storeEntity(JDBCStoreManager.java:651)
      2005-11-19 18:19:53,163 INFO [STDOUT] at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenceManager.java:413)
      2005-11-19 18:19:53,163 INFO [STDOUT] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:390)
      2005-11-19 18:19:53,163 INFO [STDOUT] at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:743)
      2005-11-19 18:19:53,163 INFO [STDOUT] at org.jboss.ejb.GlobalTxEntityMap$2.synchronize(GlobalTxEntityMap.java:134)
      2005-11-19 18:19:53,163 INFO [STDOUT] at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.synchronize(GlobalTxEntityMap.java:253)
      2005-11-19 18:19:53,163 INFO [STDOUT] at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.beforeCompletion(GlobalTxEntityMap.java:302)
      2005-11-19 18:19:53,163 INFO [STDOUT] at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1384)
      2005-11-19 18:19:53,163 INFO [STDOUT] at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1076)
      2005-11-19 18:19:53,163 INFO [STDOUT] at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:296)
      2005-11-19 18:19:53,163 INFO [STDOUT] ... 52 more

      I'm using JBoss 4.0.2, Sql Server 2000 and EJB 2.0. Remotely, my JSP page calls the following Stateless Session Bean, which calls locally the MovExBean Entity Bean. So, here is the code:


      package br.com.labgaspar.session;

      import br.com.labgaspar.entities.*;
      import javax.ejb.*;
      import java.util.*;

      public class StatusExameSBean implements javax.ejb.SessionBean, br.com.labgaspar.session.StatusExameSRemoteBusiness, br.com.labgaspar.session.StatusExameSLocalBusiness {
      private javax.ejb.SessionContext context;

      public void modificaTodos(java.lang.Integer codigoPedido, java.lang.String postoPedido, java.lang.String usuario, java.lang.String status) throws javax.ejb.FinderException{

      PedidoLocalHome pedidoLHome = this.lookupPedidoBean();
      PedidoLocal pedidoL = pedidoLHome.findByPrimaryKey(new PedidoPK(codigoPedido, postoPedido));

      UsuarioLocalHome usuarioLHome = this.lookupUsuarioBean();
      UsuarioLocal usuarioL = usuarioLHome.findByPrimaryKey(usuario);

      Iterator itMovex = pedidoL.getMovExBean().iterator();

      while(itMovex.hasNext()){

      MovExLocal movexL = (MovExLocal) itMovex.next();
      if(!movexL.getExameDigitado().equalsIgnoreCase(status)){
      //seta o usuario q fez o usuario
      if(status.equalsIgnoreCase("L")){
      movexL.setUsuLiberado(usuarioL);
      }
      else{
      if(status.equalsIgnoreCase("D")){
      movexL.setUsuResultado(usuarioL);
      }
      }
      }
      movexL.setExameImpresso(status); /*---->>>> here it works fine !!! */
      }
      }

      public void modifica(java.lang.Integer codigoPedido, java.lang.String postoPedido, java.lang.Integer ordemMovex, java.lang.String usuario, java.lang.String status) throws javax.ejb.FinderException{

      MovExLocalHome movexLHome = this.lookupMovExBean();
      MovExLocal movexL = movexLHome.findByPrimaryKey(new MovExPK(ordemMovex, codigoPedido, postoPedido));

      UsuarioLocalHome usuarioLHome = this.lookupUsuarioBean();
      UsuarioLocal usuarioL = usuarioLHome.findByPrimaryKey(usuario);
      if(!movexL.getExameDigitado().equalsIgnoreCase(status)){
      if(status.equalsIgnoreCase("L")){
      movexL.setUsuLiberado(usuarioL);
      }
      else{
      if(status.equalsIgnoreCase("D")){
      movexL.setUsuResultado(usuarioL);
      }
      }
      }
      movexL.setExameDigitado(status); /* --->>>> here is PROBLEM !!!! */
      }


      private br.com.labgaspar.entities.MovExLocalHome lookupMovExBean() throws javax.ejb.FinderException{
      try {
      javax.naming.Context c = new javax.naming.InitialContext();
      br.com.labgaspar.entities.MovExLocalHome rv = (br.com.labgaspar.entities.MovExLocalHome) c.lookup("java:comp/env/ejb/MovExBean");
      return rv;
      }
      catch(javax.naming.NamingException ne) {
      java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne);
      throw new RuntimeException(ne);
      }
      }

      private br.com.labgaspar.entities.PedidoLocalHome lookupPedidoBean() {
      try {
      javax.naming.Context c = new javax.naming.InitialContext();
      br.com.labgaspar.entities.PedidoLocalHome rv = (br.com.labgaspar.entities.PedidoLocalHome) c.lookup("java:comp/env/ejb/PedidoBean");
      return rv;
      }
      catch(javax.naming.NamingException ne) {
      java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne);
      throw new RuntimeException(ne);
      }
      }

      private br.com.labgaspar.entities.UsuarioLocalHome lookupUsuarioBean() {
      try {
      javax.naming.Context c = new javax.naming.InitialContext();
      br.com.labgaspar.entities.UsuarioLocalHome rv = (br.com.labgaspar.entities.UsuarioLocalHome) c.lookup("java:comp/env/ejb/UsuarioBean");
      return rv;
      }
      catch(javax.naming.NamingException ne) {
      java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne);
      throw new RuntimeException(ne);
      }
      }

      public void setSessionContext(javax.ejb.SessionContext aContext) {
      context = aContext;
      }

      public void ejbActivate() {

      }

      public void ejbPassivate() {

      }

      public void ejbRemove() {

      }
      public void ejbCreate() {
      }




      }

      And here are the deployment descriptors:


      ejb-jar.xml:


      jdbc:microsoft:sqlserver://localhost\srvsql:1433;DatabaseName=BD_SOFTLAB_GASPAR [sa on dbo]
      <display-name>MovExEB</display-name>
      <ejb-name>MovExBean</ejb-name>
      <local-home>br.com.labgaspar.entities.MovExLocalHome</local-home>
      br.com.labgaspar.entities.MovExLocal
      <ejb-class>br.com.labgaspar.entities.MovExBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>br.com.labgaspar.entities.MovExPK</prim-key-class>
      false
      <abstract-schema-name>MovEx</abstract-schema-name>
      <cmp-field>
      <field-name>ordemMovex</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>codigoPedido</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>numeroAmostras</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>postoPedido</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>precoUnitario</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>codFormulario</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>complemento</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>numeroDaAmostra</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>exameDigitado</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>exameImpresso</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>examePronto</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>dataEntregaMaterial</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>precoUniConv</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>fichatrab</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>noGuia</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>rowguid</field-name>
      </cmp-field>

      auto generated method
      <query-method>
      <method-name>findByOrdemMovex</method-name>
      <method-params>
      <method-param>java.lang.Integer</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(m) FROM MovEx AS m WHERE m.ordemMovex = ?1</ejb-ql>


      auto generated method
      <query-method>
      <method-name>findByCodigoPedido</method-name>
      <method-params>
      <method-param>java.lang.Integer</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(m) FROM MovEx AS m WHERE m.codigoPedido = ?1</ejb-ql>


      auto generated method
      <query-method>
      <method-name>findByNumeroAmostras</method-name>
      <method-params>
      <method-param>java.lang.Integer</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(m) FROM MovEx AS m WHERE m.numeroAmostras = ?1</ejb-ql>


      auto generated method
      <query-method>
      <method-name>findByPostoPedido</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(m) FROM MovEx AS m WHERE m.postoPedido = ?1</ejb-ql>


      auto generated method
      <query-method>
      <method-name>findByPrecoUnitario</method-name>
      <method-params>
      <method-param>java.lang.Double</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(m) FROM MovEx AS m WHERE m.precoUnitario = ?1</ejb-ql>


      auto generated method
      <query-method>
      <method-name>findByCodFormulario</method-name>
      <method-params>
      <method-param>java.lang.Integer</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(m) FROM MovEx AS m WHERE m.codFormulario = ?1</ejb-ql>


      auto generated method
      <query-method>
      <method-name>findByComplemento</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(m) FROM MovEx AS m WHERE m.complemento = ?1</ejb-ql>


      auto generated method
      <query-method>
      <method-name>findByNumeroDaAmostra</method-name>
      <method-params>
      <method-param>java.lang.Integer</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(m) FROM MovEx AS m WHERE m.numeroDaAmostra = ?1</ejb-ql>


      auto generated method
      <query-method>
      <method-name>findByExameDigitado</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(m) FROM MovEx AS m WHERE m.exameDigitado = ?1</ejb-ql>


      auto generated method
      <query-method>
      <method-name>findByExameImpresso</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(m) FROM MovEx AS m WHERE m.exameImpresso = ?1</ejb-ql>


      auto generated method
      <query-method>
      <method-name>findByExamePronto</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(m) FROM MovEx AS m WHERE m.examePronto = ?1</ejb-ql>


      auto generated method
      <query-method>
      <method-name>findByPrecoUniConv</method-name>
      <method-params>
      <method-param>java.lang.Double</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(m) FROM MovEx AS m WHERE m.precoUniConv = ?1</ejb-ql>


      auto generated method
      <query-method>
      <method-name>findByFichatrab</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(m) FROM MovEx AS m WHERE m.fichatrab = ?1</ejb-ql>


      auto generated method
      <query-method>
      <method-name>findByNoGuia</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(m) FROM MovEx AS m WHERE m.noGuia = ?1</ejb-ql>


      auto generated method
      <query-method>
      <method-name>findByRowguid</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT OBJECT(m) FROM MovEx AS m WHERE m.rowguid = ?1</ejb-ql>





      jbosscmp-jdbc.xml :



      <ejb-name>MovExBean</ejb-name>
      <table-name>MOV_EX</table-name>
      <cmp-field>
      <field-name>ordemMovex</field-name>
      <column-name>ordem_movex</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>codigoPedido</field-name>
      <column-name>codigo_pedido</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>numeroAmostras</field-name>
      <column-name>numero_amostras</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>postoPedido</field-name>
      <column-name>posto_pedido</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>precoUnitario</field-name>
      <column-name>preco_unitario</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>codFormulario</field-name>
      <column-name>cod_formulario</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>complemento</field-name>
      <column-name>complemento</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>numeroDaAmostra</field-name>
      <column-name>numero_da_amostra</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>exameDigitado</field-name>
      <column-name>exame_digitado</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>exameImpresso</field-name>
      <column-name>exame_impresso</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>examePronto</field-name>
      <column-name>exame_digitado</column-name>
      <!--<column-name>exame_pronto</column-name>-->
      </cmp-field>
      <cmp-field>
      <field-name>dataEntregaMaterial</field-name>
      <column-name>data_entrega_material</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>precoUniConv</field-name>
      <column-name>preco_uni_conv</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>fichatrab</field-name>
      <column-name>fichatrab</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>noGuia</field-name>
      <column-name>no_guia</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>rowguid</field-name>
      <column-name>rowguid</column-name>
      </cmp-field>


      Any help will be very welcome.