If comment out the update() with out making any other changes I get:

java.sql.SQLException: Cannot insert the value NULL into column 'department', table 
'helpdesk.dbo.hlpemployees'; column does not allow nulls. INSERT fails.

But, if I go in and comment out the department value in my mapping, and let the field 
accept nulls in the database, it does act as expected, i.e. it throws the 
DuplicateEntryException and nothing else. This however, doesn’t solve my problem as I 
need to have a user linked to a department and vice versa. It does at least get us 
pointed at where the problem is though.

Any other suggestions and I'll be willing to try them out. Thanks for the help.
-Nick

-----Original Message-----
From: Stein M. Hugubakken [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 20, 2004 9:06 AM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Duplicate entry problem...


Nick Stuart wrote:
> The I get the error saying that user is linked to another object that 
> is not being updated. :(
> 
> I only have had this issue with MS-SQL server, it seems. I have run other tests 
> (with a whole different program and database server (hsqldb,mysql) mind you) that 
> try to cause this error and nothing bad happens.
> 
> And I do essentially the same thing as in the helper class, besides updating the 
> other objects that are related to the one I am trying to create.
> 

Now that I've read your reply again I think I misunderstood when I suggested to try 
another jdbc-driver.

You haven't run the exact same test-code on other databases, right?

And you didn't remove the line "db.update(user.getDepartment());" to see if that is 
where the problem really is?

Stein

-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a 
subject of:
        unsubscribe castor-dev



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.634 / Virus Database: 406 - Release Date: 3/18/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.634 / Virus Database: 406 - Release Date: 3/18/2004
 

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to