Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] SessionCustomizer to modify/detect database platform: impossible

Comment inline


<snip>
    2. Try to override the auto-detection yourself.  This would involve roughly
    the following steps

       - Use the eclipselink.target-database property in your persistence.xml to
    set a platform... Any platform. (this setting will make EclipseLink avoid
    it's own auto-detection code)


Yep, did that.

       - In a prelogin event use the code from our
    DatabaseSessionImpl.__loginAndDetectDatasource method to use our
    auto-detection code and then override the InformixPlatform if it is detected.


I did this originally.  The very next thing that happens is
DatabaseSessionImpl.loginAndDetectDatasource blows the platform away.  See line
687 (on the trunk) of DatabaseSessionImpl.java and preceding.  :-(


I see this code in login in 2.3.2:

    protected static void login(DatabaseSessionImpl session, Map properties) {
String eclipselinkPlatform = (String)properties.get(PersistenceUnitProperties.TARGET_DATABASE);
        if (!session.isConnected()) {
if (eclipselinkPlatform == null || eclipselinkPlatform.equals(TargetDatabase.Auto) || session.isBroker()) {
                // if user has not specified a database platform, try to detect
                session.loginAndDetectDatasource();
            } else {
                session.login();
            }
        }
    }

Based on the code above, when you have a target database set, we should not go into loginAndDetectDAtasource. Is your experience something different.

-Tom


Back to the top