Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Foreign key constraint with create_or_extend_table is used(Foreign key constraint recreated when create_or_extend_table is used)
icon13.gif  Foreign key constraint with create_or_extend_table is used [message #1053679] Tue, 07 May 2013 08:35 Go to next message
Panisha RN is currently offline Panisha RNFriend
Messages: 35
Registered: May 2013
Member
Foreign key constraint re-created when create_or_extend_table is used.

On running my application which is using the existing database eclipse link is trying to create the foreign key constraint again and fails with the error message.

Internal Exception: java.sql.SQLException: Can't create table '.\<Database Name>\#sql-a4_151.frm' (errno: 121)

I am using Eclipse link 2.4.0.

Can any one help me how to avoid re-creation is foreign key constraint.

Thanks in advance.
Re: Foreign key constraint with create_or_extend_table is used [message #1053767 is a reply to message #1053679] Tue, 07 May 2013 14:22 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1039
Registered: July 2009
Senior Member
Is this causing a failure? EclipseLink should try to create all constraints, but any exceptions should just be logged and not prevent the app from running.

Best Regards
Chris
Re: Foreign key constraint with create_or_extend_table is used [message #1057786 is a reply to message #1053767] Wed, 08 May 2013 17:48 Go to previous messageGo to next message
Panisha RN is currently offline Panisha RNFriend
Messages: 35
Registered: May 2013
Member
Hello Delahunt,

First of all thank you so much for your reply.

Eclipse link not causing the failure, but why does it trying to create the constaint which is alreday exist.

In my case i am using existing table where in all the constraits are already applied to all the table and eclipse link trying to create it agian when create_or_extend ddl generation option is used.

I was using Hibernate earlier with "update" option there was no issue with that.

Why Eclipse link trying to create the constraint which is already exist?

Is it a bug in Eclipse link 2.4.0

Please help me to clarify my doubt.
Re: Foreign key constraint with create_or_extend_table is used [message #1057791 is a reply to message #1057786] Wed, 08 May 2013 18:52 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1039
Registered: July 2009
Senior Member
EclipseLink issues the create constraint statement rather than checking if each constraint exists and then issuing a create statement if it isn't. It then logs the error it encounters if it cannot create the constraint, I believe at the warning level. These messages can be ignored, and if you don't want to see the messages logged, set logging to a lower level than warning.

Best Regards,
Chris
Previous Topic:create a function via nativeQuery
Next Topic:create_or_extend_Tables ddl generation issue
Goto Forum:
  


Current Time: Fri Dec 19 09:27:13 GMT 2014

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

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