This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems with container managed transaction  RSS feed

 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
1. I have a jsp which calls a stateless session facade
2. My stateless session facade itelf calls a findbyprimarykey finder of an entity bean
3. My entity bean has a collection of another entity bean

A . When I set the trans attribute of my session facade methods to Required and the trans attribute of my entity beans as Mandatory I get the following exception:



B. When I set the trans attribute of my session facade methods to Required and the trans attribute of my entity beans as Required I get the same exception as above.

C. When I set all trans attributes at supports I get the following exception:





What I am getting wrong? Any help welcome.

Julien Martin.
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to make sure that the function that is using that CMR collection is running in the same transactional context as the function that retrieved it (e.g. getCollection). It's just a matter of getting the transaction deployment descriptors correct.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
couldn't we use just a simple bean which has the collection of entity beans and the required property methods? wht you people say?
 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Have you got a idea of the trans attribute I need. I tried a lot of different combination to no avail.

Here are the sources for my ejbs:
http://www.parispano.com/test_guide/ejb_tier/src/com/softwareag/test_guide/

Here are my jsps:
http://www.parispano.com/test_guide/web_tier/

Hoping to get your reply,

Julien.
 
Brian Tinnel
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't read the files you are pointing to. But the exception makes me think that your are getting one or more entity beans in one transaction, and then try to use them in a different transaction. So maybe you call methodA of a stateful bean which does a find and stores the result in a local field and returns to the jsp. Then you call methodB (or even methodA again) which will cause a new transaction to start. At that point, you cannot try to use the entity beans stored earlier because they were created under a different transaction.

Just a guess.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!