Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » foreign key constraint problem(foreign key constraint problem)
foreign key constraint problem [message #551315] Thu, 05 August 2010 17:46 Go to next message
Eclipse UserFriend
With an application that is- for now run as a java app- I am attempting to commit an entity transactions with multiple tables and multiple inserts I am getting "ERROR: insert or update on table "<table>" violates foreign key constraint "<constraint_fk>". However, I set the process to stop after persisting the 2 tables involved so I could verify what is being put in place or at least what appears to be being put in place. The id used in the parent is the one being used by the child table for the column which has the foreign key constraint. Hence, I am frankly baffled.

Is there any way to monitor the actual sql statements such as inserts that are being executed against my postgresql db?

Thanks
Re: foreign key constraint problem [message #551357 is a reply to message #551315] Fri, 06 August 2010 02:27 Go to previous message
Eclipse UserFriend
On 2010-08-05 23:46, Steven Dahlin wrote:
> With an application that is- for now run as a java app- I am attempting to commit an entity transactions with multiple tables and multiple inserts I am getting "ERROR: insert or update on table "<table>" violates foreign key constraint "<constraint_fk>". However, I set the process to stop after persisting the 2 tables involved so I could verify what is being put in place or at least what appears to be being put in place. The id used in the parent is the one being used by the child table for the column which has the foreign key constraint. Hence, I am frankly baffled.
>
> Is there any way to monitor the actual sql statements such as inserts that are being executed against my postgresql db?
>
> Thanks

You can enable logging in Eclipselink that displays in detail what SQL statements are being executed.
http://wiki.eclipse.org/EclipseLink/Examples/JPA/Logging
Previous Topic:javax.persistence.lock.timeout is beeing ignored...
Next Topic:Java Architecture for XML Binding (JAXB) - Class not found
Goto Forum:
  


Current Time: Thu Jul 03 17:01:53 EDT 2025

Powered by FUDForum. Page generated in 0.23432 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top