• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems with container managed transaction and cmr

 
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
4. I use dto to transfer data over the tiers

I tried many combinations of trans attributes to no avail.

I get the following error again and again:



All the sources for the ejb tier can be viewed here:

http://www.parispano.com/test_guide/ejb_tier/src/com/softwareag/test_guide/

I have been stuck on this for over two weeks and would accept any comments and suggestions.

Thanks in advance,

Julien Martin.
 
Adrian Marti
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Taking a guess before the experts come in. What is your transaction attribute value set to for the bean. I'm thinking you have requiresnew when u want required.

Just a guess.

*edit* oops didnt read carefully and missed the part where it says you've tried changing that. sorry.

Adrian
[ September 15, 2004: Message edited by: Adrian Marti ]
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I looked over the code, but I didn't see the deployment descriptors. BTW, I *highly* recommend using a tool like XDoclet to tag your beans and generate descriptors. It will also generate your remote/local homes and interfaces.

In any case, I suspect that the transaction is being started and ended by the method that returns the CMR collection. Thus you're trying to access the collection elements outside of the transaction. You should be able to set the trans-attribute for PGSessionFacadeBean.getEstablishmentFromId to "Required" to get it to work. Make sure the entity bean methods are not set to "RequiresNew".

Of course, you also said that you played around with the attributes, so maybe you tried that already. I had this problem with WebLogic 7.0sp1 for a while and changed my code before figuring out what the problem was. However, I still believe the above was the problem.

My solution was to create a "createDTO" method on the entity bean itself. Definitely not my first choice, but it worked. I never went back to see if the above solution would work, but it *should*.
 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks you all for your replies:
Here are the dds:
DDs
I am going to try to add a createDto method for my ejb as you advised.
Julien.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!