[jboss-user] [EJB 3.0] - Re: $Proxy200 error & Invalid (i.e. remote) invocation of lo

ezanih do-not-reply at jboss.com
Thu Jan 8 06:55:29 EST 2009


Ok, I've finally solved the problem. Since I'm using JBoss server, it seems that everything that I put directly on the classpath is overriden by what's in the JBoss client directory especially the hibernate files. So anybody using JBoss, do be careful especially when you are doing the Hibernate Compatibility Matrix portion.

Now all I need to know is, since my client is calling my session bean is calling my wrapper datasource which persists the entity to db, where do I place my em.gettransaction.begin(), em.persist(entity), em.gettransaction.commit() and em.gettransaction.rollback() commands? 

Do I do it in the client as follows :-


  |  BiddingTestBeanRemote  bidder= (BiddingTestBeanRemote) ctx.lookup("BiddingTestEAR/BiddingTestBean/remote");
  | 	            //BiddingTestBeanLocal bidder = (BiddingTestBeanLocal) PortableRemoteObject.narrow (obj, BiddingTestBean.class);
  | 
  | em.getTransaction().begin();
  | bidder.setBidder(); // call the bean's setter method
  | em.persist(bidder);
  | em.getTransaction().commit();
  | 

or in the bean as follows :-


  | em.getTransaction().begin();
  | Bidder bidder = new Bidder();
  | bidder.setBidderName("Bidder No 1");
  | bidder.setBidSessionId(1);
  | em.persist(bidder);
  | em.getTransaction().commit();
  | 


Please can somebody help.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200312#4200312

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200312



More information about the jboss-user mailing list