Avatar billede fredand Forsker
29. oktober 2009 - 22:23 Der er 1 løsning

How to fix "Could not synchronize database state with session"

Hello!

I think I have messed up big time.

First let me explain my environment.

We got a app running in a weblogic 8.1.4.
We use Hibernate as ORM together with a Oracle.

To day I shot a testcase (through SoapUI, I do not think that matter).
The testcase is inserting a new row into the database, table A, and also in table B and C.
The PrimaryKey (id) in A, B and C is the same, but B:s and C:s id:s-column is not Foreign keys to id in A (I hope I do not remember wrong)


I guess I was a bit sloopy and stopped the wls, or something, before a commit was done. Or I messed with Oracle at the same time through Toad.

How ever after next restart of everything, and a new clean shot from SoapUI gave me this:

ORA-00001: unique constraint (TEST01ADMIN.SYS_C00450

Could not synchronize database state with session
...tViolationException: Could not execute JDBC batch update

In some how it looks like the Hibernate is not in synch with my Oracle.

The constraint SYS_C00450 is the Primarary key in table A, I guess then it tries to insert a new row with an already existing id.

Is there a way to try to tell Oracle, or Hibernate, to get in synch?
Correct me if I'm wrong when I say that there is a certain counter in Oracle for id:s? (Or was that ages ago?)

Any comment is most welcome!

Best regards
Fredrik
Avatar billede fredand Forsker
29. december 2010 - 21:53 #1
closing since (almost) old!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester