Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » foreign key constraint problem(foreign key constraint problem)
foreign key constraint problem [message #551315] Thu, 05 August 2010 21:46 Go to next message
Steven Dahlin is currently offline Steven DahlinFriend
Messages: 18
Registered: May 2010
Junior Member
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 06:27 Go to previous message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 817
Registered: July 2009
Senior Member
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: Fri Apr 19 09:49:41 GMT 2024

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

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

Back to the top