Our Registration page collects details from the user and insert into database.We are using ejb to insert the row in database.database is oracle.
While inserting a new record in database, for primary key field we are passing dummy value.While insertion trigger will fire ,which internally calls sequence and generate a primary key for that row.
Now the problem is after inserting a row in database, we are not getting primary key field value in ejb from database, which is actually in the database.Rather We are getting a dummy value that we passed.
How to get the actual primary key field value
Jeroen T Wenting
Joined: Apr 21, 2006
EJB for whatever reason has no support for autogenerated primary keys. Can't be an oversight as it's been suggested to Sun with every new version and always ignored.
Generate your keys in the ejbCreate in some way and set them yourself.
Joined: Mar 02, 2005
i want to get a autogenerated key in ejb once value is inserted in DB.is there any other way???