parameters are passed by value when invoking on remote interfaces. Your addFund method must return the id or return the full Fund object back to the client.
Ok, I changed my code to return the new Fund. But now I am having problems such as:
Fund fund = new Fund();
fund = bank.addFund(fund);
System.out.println(fund.getId()); // Works!
bank.saveFund(fund); // simply calls em.persist(fund);
Exception in thread "main" javax.ejb.EJBException: null; CausedByException is:
detached entity passed to persist: com.cowgar.learn.ejb3.task.ejbs.entity.Fund
How do I either keep from getting a detached entity or re-attach the entity?
Don't be mad, but you are going to have to try out more examples if you want me to help you further. These are simple questions.
You are right. I will read more. I do wish that there was a tutorial. I have been going through the EJB 3.0 Trail Blazer and have not been having good much luck, but I will persist (he he) and make it through it, I hope.
I am glad that they are simple problems and not complex issues with how to work around this or that with JBoss :-)