• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

is this assumption correct?

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here the transaction is doomed in the method that initialised the i & j with 40 & 50
thanks
pradeep
 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic