Re: Can't access database from session bean and create entity bean within the same transaction
Thursday, October 11, 2001 06:58 AM
well, first I think you should use TX_REQUIRED on both session bean and entity bean method. It just makes more sense and TX_MANDATORY is really not necessary in this case if you design everything properly. second, my question is why didn't you do both things in a single method invocation. it simply makes more sense to obtain an ID and do a store in the entity bean itself. if you need this id in the session bean (which I am guessing works as a facade to the entity beans), simply return it from the entity bean (you will probably have to anyway since ejbCreate() returns PK in entity beans.