Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6381069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:20:57+00:00 2026-05-25T02:20:57+00:00

We use EclipseLink for persistence, and have configured EclipseLink to automatically create the database

  • 0

We use EclipseLink for persistence, and have configured EclipseLink to automatically create the database tables etc., by setting the property eclipselink.ddl-generation to drop-and-create-tables.

This works fine, however EclipseLink (and thus our app) will merrily continue during unit tests, and on actual web app startup even if some of the DDL statements failed.

I noticed this when I incorrectly used the @Index annotation, and wondered why the index was not created, until I noticed in the logs:

org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.h2.jdbc.JdbcSQLException: 
Column "MY_INDEX_FLD" not found; SQL statement:
CREATE INDEX X_INDEX ON X (MY_INDEX_FLD)

I really want to know if this happens. Is there some way to tell EclipseLink to make it a fatal error if some DDL statements fails?

I’d like to at least have our (JUnit) integration tests fail in this case.

Bonus points for some way to be able to ignore if the error is simply that the tables are already there (in the case of testing against an existing database).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:20:57+00:00Added an answer on May 25, 2026 at 2:20 am

    Apparently, EclipseLink cannot do this.

    I had a look at the method in EclipseLink that creates tables:

    org.eclipse.persistence.tools.schemaframework.TableCreator.createTables()

    (search for “createTables” on the page).

    I contains the lines:

            try {
                schemaManager.createObject(table);
                session.getSessionLog().log(SessionLog.FINEST,
                    "default_tables_created", table.getFullName());
            } catch (DatabaseException ex) {
                session.getSessionLog().log(SessionLog.FINEST,
                "default_tables_already_existed", table.getFullName());
                    if (!shouldIgnoreDatabaseException()) {
                        throw ex;
                    }
            }
    

    So apparently EclipseLink assumes that errors during table (and index) creation are always caused by the table already existing :-(.

    I filed an EclipseLink bug for this: Bug 356068.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use JPA (eclipselink) to get data from my database. The database
I'm struggling with real-world use of JPA (Hibernate, EclipseLink, etc) in a Swing desktop
I'm trying to use a MySQL database with EclipseLink using Netbeans but I keep
I use JPA persistence for my data models with Eclipselink as the persistence provider.
I use EclipseLink as my JPA2 persistence layer, and i would like to see
is there an easy approach to store my model, which I use with EclipseLink,
I have this persistence unit: <?xml version=1.0 encoding=UTF-8?> <persistence version=1.0 xmlns=http://java.sun.com/xml/ns/persistence xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd>
We are using Eclipselink for ORM, but we have a need for some more
I have to map the interface as entity to use different implementations in collections.
I use EclipseLink in my application. EclipseLink uses some connection pool. I use EclipseLink

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.