I am using Oracle 9i and have a table that generates the primary key using an insert trigger. In my Java code, I create a new object and save it to the database then, in the same transaction, I want to look up the inserted record by its name field to get the generated primary key. THe idea is
begin transaction
create new object
save object
find object
commit transaction
However, doing a session.find() for the newly inserted object returns no records. Am I doing something wrong, or is this not possible?
Thanks,
David Robison
|