You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by zl...@gmail.com on 2009/02/26 17:41:12 UTC

[Bug]ID cannot generater correct while have Trigger

Hi OpneJpa

 

I think openjpa is good project.

 

But I found bug, Can you give some suggestion about this?

 

I use mssqlserver, 

And use @GeneratedValue(strategy = GenerationType.IDENTITY)

When I insert a record into Table A, 

and print the sql found OPENJPA will get ID from @@IDENTITY

But this table have a Trigger which use to insert a recode to one audit
table.

So what  @@IDENTITY is audit table's ID not the ID of A. 

 

Maybe can change it to ident_current('tablename').

 

Thank you very much.

 

Best Regards,

Benon Zhang

||| Software Developer

Aspen Technology, Inc. ||| +86 21 513 75045 ||| fax: +86 21 513 75050 |||
cell phone: +86 13482039398