Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] question about composite persistence unit

Some comments inline:

On 03/03/2012 1:39 AM, Geronimo Ma. Hernandez wrote:
Hello,

On Friday 02 March 2012 - 19:03:48, Tom Ware wrote:
Lets take a step back.
...
https://fisheye2.atlassian.com/browse/eclipselink/trunk/examples/my-sports/
MySports/src/example/mysports/admin/AdminMetadataSource.java?hb=true

https://fisheye2.atlassian.com/browse/eclipselink/trunk/examples/my-sports/
MySports/src/example/mysports/admin/RESTAdminServerConnector.java?r=9600

Thanks for the links.

I probably was hobnailed describing my problem.
I don't need Assistance on how to write a MetaDataSource. The point is, I
don't know how to bring it into play.

The extended XML is used any time a new EntityManagerFactory is created or on a call to EntityManagerFactory.refreshMetadata() - that method is EclipseLink-specific, so you'll have to unwrap your factory to use it.

Note: The refreshMetadata() method is on EntityManagerFactory and not EntityManager. If you are dynamically extending your entities, you won't be able to use the same EntityManager to operate on the extended entities. Instead, you call refreshMetadata() and from then on every EntityManager you obtain from the EntityManagerFactory will use the extended entities. Previously created EntityManagers will use the old mappings.


Anyway - after sessions of research and debug, I have to confess, that I was
wrong on my last post:

	 I do need dynamic extension of known entities.

The workflow of my app is like this:
- authentication happens at splashscreen (no extension-plugin might have been
loaded at that point)

- application is loaded and navigation tree is shown (uses statically
published entities from app core)

- the user decides to expand a tree node, which triggers the activation of an
extension plugin. That's the point, I have to inform the EntityManager about
new classes, it should care about.


Persistence (in my app) is an application service, coded in core app and
published as a service - so all extensions will use the same application-
session from authentication.

I dived into the eclipselink sources and found a
EntityManagerSetupImpl.updateDescriptorCacheSettings(...) - I know, that's
internal stuff, but is there a way to trigger that call (or similar action)
from application?

What is your goal in calling this method?


I could imagine a Properties instance in my app, which gets extended by
extension-plugin activation and for so always holds the pool of known entity-
names.
Binding that PropertyMap to a Handler of the EntityDescriptorCache, dynamic
change of supported classes could be established.

Don't know how weaving interferes this game, but using static weaving should
make the binaries fit into dynamic play. Can I trigger weaving at build-
process?

I'm not sure I understand the two paragraphs above.



kind regards

Gero

P.S. digging the sources, I hit DatabaseSessionImpl - is it true, that in SE-
environments only one database connection is supported/allowed?
Before eclipselink, I was using connectionpool from apache.
Is there a way to use connectionpools with eclipselink?

JPA applications and most enterprise applications tend to use ServerSession and ClientSession (rather than directly using DatabaseSessionImpl). Connection pools are supported by server session.


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top