You can't use fields set by the db on insert with jboss. There is no way for jboss to find the new values (at least no implemented way). You have to find some way to have your bean find the pk value before it inserts the row. There are hundreds of posts arguing about the best way to get such a value, suggesting such arcane procedures as using a random number and retrying on failure, constructing a guid from the server id and the time, etc etc. Personally I like the idea of having an mbean that gets the next id from the database, and your bean gets the id from the mbean. If you have something like sequences with configurable step size, you can set the step fairly large and avoid some db access (hand out the ones in between steps yourself). With identity columns, you will probably need a separate table with just the identity: insert and read, then delete, or write a stored procedure to do this.