Bojan Kraut Messages: 22 Registered: July 2009 Location: Maribor
Junior Member
Hi,
My question is regarding architecture of greenpages application.
There is a jpa bundle, which uses db bundle to get necessary data to connect to the database. jpa bundle instantiates an enttymanager which is used to access the data.
Let say id like to have two additional bundles - orders and invoices, which would use the same entitymanager. Is this possible? Or every bundle must have its own entity manager defined? How are runtime data shared? Is let say an account[id=5435] loaded in memory in two bundles or can both bundles access the same information?
If your each bundle needs a EntityManagerFactory, you might need to publish the EntityManagerFactory as a service, then get or inject the service to your bundle.