I had this persistence code that worked just fine. Now I created a statelss session bean on top of it so now code looks like this.
Stateless session bean has bean managed transaction, this bean calls method x that calls method y. method y is an existing method that uses JTA and demarcates the transaction. Now the problem is that if I have 2 DB entitites then when I persist the first one second entity can't see the first one. However, earlier method y used to worked fine when it was part of the servlet. Do I need to open another transaction in method x now ? Please advise.