Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is this assumption correct?

 
pradeep arum
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a CMT stateful session bean with variables initialised
int i=10,j=20;//first filled with
with a method in it changing the variable values to
i=40;
j=50
, and is a part of a transaction,now the transaction is doomed,and so what will the variable values be? do i have to use the sessionSynchronisation interface aftercompletion() method ...with the boolean value=false ..to re-initialise the variables to i=10 and j=20.
because the transaction is rolled back by the container ...will the container take care of the re-initialisation of variables,i mean will they not automatically get back to i=10 and i=20 ?not just the data in the database?
this question should not arise if i write any-piece of code!!!but i think of writing code after i finish HFE
please help
thanks
Pradeep

This question should not arise if i write any code
 
pradeep arum
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here the transaction is doomed in the method that initialised the i & j with 40 & 50
thanks
pradeep
 
Keith Rosenfield
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Session bean state is not transactional. It is up to the bean developer to ensure that if a transaction fails that the state is reset.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic