[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: AW: [eclipselink-users] DDL warning because table exists
|
When you tell EclipseLink to create tables, it seems to me to be fairly
reasonable that it will warn you when it cannot do that.
It is true that it would be possible to check the metadata in the database to
see if the tables match, but doing that in a database agnostic manner might be
difficult and many users might want the warning anyway.
For most applications, the DDL generation option will only be used at the
prototyping and development stage - by the time you go to production, nearly all
applications will be at a stage where it is well defined how tables will look
and they will not longer be regenerated from entities.
-Tom
Daniel.Stucky@xxxxxxxxxxx wrote:
Well,
as „/drop-and-create-tables/” will delete the stored data this is not an
option.
A complete check of the entities vs. the tables would be fine for me. A
warning/error should only be generated if there are differences.
Assuming that entities are stable and are equal to the already created
tables, a user/admin of our application will always see and be worried
about these warnings in the log.
I know that this warning is absolutely not critical, but others will
not. I guess the implementation is just a little slack and could be
improved.
Bye,
Daniel
*Von:* eclipselink-users-bounces@xxxxxxxxxxx
[mailto:eclipselink-users-bounces@xxxxxxxxxxx] *Im Auftrag von *Kasper
Hansen
*Gesendet:* Donnerstag, 19. Februar 2009 10:35
*An:* EclipseLink User Discussions
*Betreff:* Re: [eclipselink-users] DDL warning because table exists
Hi,
Then what about changes to your domain objects (entities) ? A simple
check is not enough, it should compare each property.
Can't you just use this; <property name="eclipselink.ddl-generation"
value="drop-and-create-tables"/>
:-) Kasper
On Thu, Feb 19, 2009 at 10:20 AM, <Daniel.Stucky@xxxxxxxxxxx
<mailto:Daniel.Stucky@xxxxxxxxxxx>> wrote:
Hi all,
In my persistence.xml I'm using eclipselink.ddl-generation=create-tables
If my application is started the 2nd time, the tables do already exist
(of course).
This leads to the following warning:
[EL Warning]: 2009.02.18
09:21:33.154--ServerSession(27887470)--Exception [EclipseLink-4002]
(Eclipse Persistence Services - 1.0.2 (Build 20
081024)): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: SQL Exception: Table/View 'RECORDS' already exists
in Schema 'SMILA'.
Error Code: 30000
Call: CREATE TABLE RECORDS (ID VARCHAR(1024) NOT NULL, SOURCE
VARCHAR(1024), RECORD BLOB, PRIMARY KEY (ID))
In my opinion there should not be a warning at all. Instead of executing
the create table SQL statement it should be checked if the table already
exists and only execute the SQL if it does not.
Is it possible to somehow suppress this warning ? Changing the log level
is not what I'm looking for :-)
Bye,
Daniel
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx <mailto:eclipselink-users@xxxxxxxxxxx>
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
------------------------------------------------------------------------
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users