openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Beer <david.m.b...@googlemail.com>
Subject Sequence Generator on a non ID field
Date Wed, 23 Feb 2011 14:30:41 GMT
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


Mime
View raw message