• Post Reply Bookmark Topic Watch Topic
  • New Topic

After rollback data posting in next transaction  RSS feed

 
Bill Mccrae
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are using EJB2  (I know... it's a legacy system)
Oracle Database
Weblogic Middleware

All of this is in a service bean with transaction = Required

The scenario goes like this:

We get the current entity for a person in a bean
We change a flag (Y to N)
Update database
Generate a new entity bean for person with different primary key
Add a new record with this new entity bean
Persist to database
Later an application exception is thrown
We setRollBack()
And rethrow

We log out of system, and check database - All appears to have rolled back.  (Flag still Y and the newly Added record is not in the database)

Log in as different user.
Start process over from the top for the same person going through the same code
Get the current entity in a bean  -- The entity retrieved is not the rolled back entity, it is the entity with flag change (flag = N) and then it commits the flag change (to N) to the database at the time of the get -- NO commit is done

The add does truly get rolled back as it is not in the database but the Flag change to N is now in the database.


ANY thoughts as to why the bean is getting updated when the next user comes through the code?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!