|Re: [eclipselink-dev] Fwd: [Bug 455690] Add support to allow ServerPlatforms to do additional initialization|
Setting jndi look up type in ServerPlatform constructor is bad
- what if we set server platform before connector (which is normally the case - see EntityManagerSetupImpl);
- what if we switch from one server platform to another (say, websphere specified in persistence.xml, but weblogic in puProperties passed to createEMFactory);
Setting lookup type right before session connects would resolve those problems, but we would need to loop through all the connectors (write, read, sequence, possibly custom connection pools).
Still not covered the case of creating custom connector after server session has been created (through entity manager property for an individual entity manager).
My suggestion is to add getJndiLookupType method to ServerPlatform (returning STRING_LOOKUP in ServerPlatformBase).
In JNDIConnector constructor initialize lookupType with UNDEFINED value and in connect method - in case the type is still UNDEFINED - copy lookupType from session.getServerPlatform.getJndiLookupType.
On 12/18/2014 5:31 PM, Rick Curtis wrote:
Back to the top