Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Enforcing schema versioning

Hi,

I'm trying to solve a classic problem in my EclipseLink-based product.
When the product starts up, it needs to reassure itself that the
database is in the shape it expects.

The usual way we've done this in the past is to have a "metadata" table
in the database which contains a bucket of key-value pairs, e.g.
version=1. We can then increment the version number as we add/alter
tables, and the code can check this to ensure it's not running on a
database at the wrong version.

The difficulty I'm having is finding a nice way to do this in
EclipseLink. At the moment, we're using a SessionEventListener to
execute the check in postLogin, however this feels more difficult/messy
than it should be. How do other users solve this problem? Is there a
different approach that feels more natural in EclipseLink?

Thanks,
David


Back to the top