Hi David, Could you post the stack for the exception you're getting?
GeneratedValues should be obtained by your non-jta-data-source (or openjpa.ConnectionFactory2) - and that shouldn't require a transaction. -mike On Wed, Feb 23, 2011 at 8:30 AM, David Beer <david.m.b...@googlemail.com>wrote: > Hi all > > I am trying to get a value for a field set when commited to the db, to > be auto generated. This field is not an ID for the table. I seem to get > the error message "InvalidStateException: Can only perform operation > while a transaction is active." > > My class looks like the following: > > @GeneratedValue(strategy = GenerationType.TABLE, generator = "UserGen") > @TableGenerator(name = "UserGen", table = "USER_GEN", pkColumnName = > "PK", valueColumnName = "USERID") > private Long userID; > > Any Thoughts. > > Thanks > > David > >