Hello Experts,
I am using weblogic 8.1 App server and MS SQL 2000 as database server for my EJB Application. I have an entity bean called Session which has a sessionId as its primary key.This primary key is an identity field in the database. I have used weblogic's automatic-key-generation for generating the primary key whenever i create a new 'Session' entity. I also create the entity bean in a transaction.
Now the problem is that after creating a 'Session' entity using create() method, when i try to retrieve the generated primary key using getSessionId() , i get an older value of sessionId than the one which is currently created in the database.
For example if the current row inserted in the database after calling SessionHome.create() has a primary key value '21' , on calling getSessionId() i get the value as '20'. I must remind that this occurs in a transaction.
Has anyone come across such a problem
Yaser
-
Weblogic Entity Bean Primary Key Problem Help!! (1 messages)
- Posted by: Yaser Ansari
- Posted on: July 29 2003 12:49 EDT
Threaded Messages (1)
- Weblogic Entity Bean Primary Key Problem Help!! by Andrea Vettori on July 29 2003 14:07 EDT
-
Weblogic Entity Bean Primary Key Problem Help!![ Go to top ]
- Posted by: Andrea Vettori
- Posted on: July 29 2003 14:07 EDT
- in response to Yaser Ansari
Where do you call that method ?
If inside create, I think that primary key can't be accessed in create method (you can in postcreate).
Please, correct me if I'm wrong.