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

Good news.  If we specify a target-database value that we have no intention of using, this has the happy side effect of short circuiting the EclipseLink autodetection code which was stomping on my SessionCustomizer's newly installed platform.  I'll move on now and make sure that we don't encounter the QuerySequence.java bug as a result (think that we're getting in early enough in the process here that the platform is getting initialized properly this time).

Thanks for your help.  I'll post my SessionCustomizer here for reference once I've got it cleaned up.

Best,
Laird


On Thu, Feb 21, 2013 at 10:24 AM, Tom Ware <tom.ware@xxxxxxxxxx> wrote:
org.eclipse.persistence.platform.database.DatabasePlatform is likely a good dummy value. (the same as the default)


On 21/02/2013 1:19 PM, Laird Nelson wrote:
On Thu, Feb 21, 2013 at 10:15 AM, Tom Ware <tom.ware@xxxxxxxxxx
<mailto:tom.ware@xxxxxxxxxx>> wrote:

        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.


No, I think I didn't try the combination you're suggesting (explicitly specify a
platform (the "wrong" platform) AND then run my auto-detection logic (really,
just emulate yours) DURING a preLogin() event.  I've done some combination of
that with the SessionCustomizer (that's what I was thinking of) but it looks
like setting the target platform to a "dummy" value may get me out of the woods
here....

Best,
Laird

--
http://about.me/lairdnelson


_______________________________________________
eclipselink-users mailing list
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



--
http://about.me/lairdnelson

Back to the top