ava:37) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2449) at
net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2435) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2392) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2261) at
No...i want to create a new order ...which inserts a new row in the table. But it is not able to insert due to this unique constraint problem. even if i disable the constraint for that particular coloumn , the error is same. i will add the hbm file..
posted 12 years ago
i tried to post hbm file contents but javaranch site is not allowing me to update the file contents.. how do i do this?
To post code, there is a CODE tag below the Add Reply button. So you open your file in some text editor, and copy and paste it into a post. Unfortunately, I cannot read what you posted because it has no indentation and all meshed into one paragraph.
So explain what you mean by you wanting to re-order? Based on what, I hope not your ID.
You said you disabled the constraint, but that still looks to me like a database constraint. Could you check constraint UK_PROJECT_REFERENCE in your database to make sure that is the one you in fact disabled? [ December 15, 2007: Message edited by: Bougnon Kipre ]
What is the next val from the UST_DOSSIER_SEQ, is it a value that already has a record in the database with that PK id? Did you reset your sequence to 0 because you wanted it re-ordered, but you already have records in your database with those PK values?
I have disabled the constraint for UK_PROJECT_REFERENCE. I checked twice to confirm . But still the problem is same. I am surprising.
Thanks and Regards, Chandrakanth
posted 12 years ago
Hello Mark Spritzler,
Actually i changed the sequence and still the problem remains same. Before the row is going to insert in UST_DOSSIER table, a TRIGGER will create the UST_PROJECTREFERENCE number and isert in to the coloumn.
Nevermind. Even i thought the problem could be trigger. But since many months it did not given any problem. Just recently the problem has arised. And we dont know why?? Here is hte trigget which fills the coloumn:--
Do you find any problem in this trigger.
[ Edited to use code tags - Paul Sturrock ] [ December 18, 2007: Message edited by: Paul Sturrock ]
What is this for? SUBSTR(TO_CHAR(SYSDATE, 'YYYYMM'),3)
To me it looks like you are trying to get the current date in YYMM format. The last two digits of the Year then the two digits of the Month. So why use YYYYMM and Substring combined, can't you just use TO_CHAR(SYSDATE, 'YYMM') ?
So this trigger for this field, what is its purpose, do you really need it? What value is it creating that your application needs? Waht is the result it is returning that is a value that is already in the database? That is what you need to look for.