• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

is this assumption correct?

 
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
 
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.
 
There's a way to do it better - find it. -Edison. A better tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic