2

The Informix support in EclipseLink 2.3.2 (and probably later) has a fairly serious bug in it where outer joins are not performed properly. I'd like to subclass the EclipseLink InformixPlatform class to work around this.

For various reasons, I don't want to specify the database platform to use in my persistence.xml. I would rather rely on EclipseLink's ability to discover the proper platform to use.

Obviously EclipseLink out of the box does not know about my subclass. How can I tell EclipseLink that my subclass exists, and that it should be preferred to the normally-auto-discovered one?

For comparison purposes, Hibernate features a bit of machinery under the label of "dialect resolvers" that does exactly this: hand it a custom dialect resolver and it lets you deal with the autodiscovery process. What is the equivalent in EclipseLink 2.3.2?

Laird Nelson
  • 15,321
  • 19
  • 73
  • 127
  • I see the `eclipselink.session-event-listener` property, but I am not sure if that is going after a mosquito with a steam hammer. Would that be the proper approach? – Laird Nelson Feb 15 '13 at 17:11
  • Looking at the code, it would actually not work, because if I attempted to set the platform from my session event listener, it is immediately `null`ed out by `loginAndDetectDatasource()` after my listener returns! – Laird Nelson Feb 15 '13 at 17:13
  • Ugly: perhaps I should trap the `postLogin` event, logout, then set the platform I want to use, then login again. I hope there's a better way! – Laird Nelson Feb 15 '13 at 17:18
  • This general approach does not appear to be working. Doing this leads to `NullPointerException`s from within `QuerySequence` later, when you try to insert an entity with a table generator. Running out of ideas. – Laird Nelson Feb 20 '13 at 18:12
  • I'm now going to try the `SessionCustomizer` approach. There is no documentation on this class that indicates where in the lifecycle it is called. – Laird Nelson Feb 20 '13 at 18:32
  • The lifecycle is OK, but all the platform customization work that is performed here is overwritten. I'm going to scream. – Laird Nelson Feb 21 '13 at 06:33
  • `SessionCustomizer` won't do it; see https://bugs.eclipse.org/bugs/show_bug.cgi?id=401388. There does not appear to be any way to do this. – Laird Nelson Feb 21 '13 at 07:19

1 Answers1

0

There is no way to programmatically install a DatabasePlatform subclass without running into other bugs. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=401388 for details.

Laird Nelson
  • 15,321
  • 19
  • 73
  • 127