You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Boblitz John <jo...@bertschi.com> on 2013/10/10 09:33:30 UTC
Initialization Errors when unsing multiple PersistenceUnis in
persistence.xml
Hello,
I have a rather "simple" system configuration and wanted to simplify my persistence configuration by adding
persistence-unit defintions to the persistence.xml. I basically have one pu definition for each environment (dev/tst/prd).
On each system, there are several services which use the same pu definition but have their own instance of the pu. These communicate with each other
via activeMQ to keep the caches in synch.
Until now, I had one PU and in each service/environment the persistence configuration was included in a conf file and passed to the emf.
The multiple pu's work just fine, as long as there is no error in ANY of them.
However, if ANY one of the pu's has an error in the RemoteCommitProvider definition - jpa will not start.
This occurs in the PCEnhancerAgent.registerClassLoadEnhancer which appears to loop over each pu and create a OpenJPAConfigurationImpl. In the loop the
instantiateAll() method is invoked on each conf - whether I wanted to load that pu or not! - that in tune causes the RemoteCommitProvider to be created ...
IF, when starting my development environment, the test environment is not online (or reachable) the start will fail.
Is there a reason that we need to process persistence-unit definitions which are not requested?
Setting DynamicEnhancementAgent to false resolves the problem ....
John
----
Who is General Failure, and why is he reading my hard disk?
RE: Initialization Errors when unsing multiple PersistenceUnis in
persistence.xml
Posted by Boblitz John <jo...@bertschi.com>.
Hello Rick,
JIRA created: https://issues.apache.org/jira/browse/OPENJPA-2436
Cheers,
John
> -----Original Message-----
> From: Rick Curtis [mailto:curtisr7@gmail.com]
> Sent: Thursday, October 10, 2013 3:40 PM
> To: users
> Subject: Re: Initialization Errors when unsing multiple PersistenceUnis in
> persistence.xml
>
> Yes, please do.
>
> Thanks,
> Rick
>
>
> On Thu, Oct 10, 2013 at 8:02 AM, Boblitz John
> <jo...@bertschi.com>wrote:
>
> > Hi Rick,
> >
> > should I make a Jira for that?
> >
> > Cheers,
> >
> > John
> >
> > > -----Original Message-----
> > > From: Rick Curtis [mailto:curtisr7@gmail.com]
> > > Sent: Thursday, October 10, 2013 2:53 PM
> > > To: users
> > > Subject: Re: Initialization Errors when unsing multiple
> > > PersistenceUnis
> > in
> > > persistence.xml
> > >
> > > > Is there a reason that we need to process persistence-unit
> > > > definitions
> > > which are not requested?
> > > The DynamicEnhancementAgent was added as a feature to assist 'new'
> > > users get up and running with minimal effort. Unfortunately this
> > > feature
> > wasn't/isn't
> > > 100% solid, and this is clearly a bug. In the event that an invalid
> > > PU is encountered, a message should be logged and the error should
> > > be
> > tolerated.
> > >
> > > I would advise setting the DynamicEnhancementAgent to false to avoid
> > > this bug, and obviously you're enhancing via another method.
> > >
> > > Thanks,
> > > Rick
> > >
> > >
> > > On Thu, Oct 10, 2013 at 2:33 AM, Boblitz John
> > > <jo...@bertschi.com>wrote:
> > >
> > > > Hello,
> > > >
> > > > I have a rather "simple" system configuration and wanted to
> > > > simplify my persistence configuration by adding persistence-unit
> > > > defintions to the persistence.xml. I basically have one pu
> > > > definition for each environment (dev/tst/prd).
> > > >
> > > > On each system, there are several services which use the same pu
> > > > definition but have their own instance of the pu. These
> > > > communicate with each other via activeMQ to keep the caches in synch.
> > > >
> > > > Until now, I had one PU and in each service/environment the
> > > > persistence configuration was included in a conf file and passed
> > > > to
> > the emf.
> > > >
> > > > The multiple pu's work just fine, as long as there is no error in
> > > > ANY of them.
> > > >
> > > > However, if ANY one of the pu's has an error in the
> > > > RemoteCommitProvider definition - jpa will not start.
> > > >
> > > > This occurs in the PCEnhancerAgent.registerClassLoadEnhancer which
> > > > appears to loop over each pu and create a OpenJPAConfigurationImpl.
> > > > In the loop the
> > > > instantiateAll() method is invoked on each conf - whether I wanted
> > > > to load that pu or not! - that in tune causes the
> > > > RemoteCommitProvider to be created ...
> > > >
> > > > IF, when starting my development environment, the test environment
> > > > is not online (or reachable) the start will fail.
> > > >
> > > >
> > > > Is there a reason that we need to process persistence-unit
> > > > definitions which are not requested?
> > > >
> > > > Setting DynamicEnhancementAgent to false resolves the problem ....
> > > >
> > > >
> > > >
> > > > John
> > > > ----
> > > > Who is General Failure, and why is he reading my hard disk?
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > *Rick Curtis*
> >
>
>
>
> --
> *Rick Curtis*
Re: Initialization Errors when unsing multiple PersistenceUnis in persistence.xml
Posted by Rick Curtis <cu...@gmail.com>.
Yes, please do.
Thanks,
Rick
On Thu, Oct 10, 2013 at 8:02 AM, Boblitz John <jo...@bertschi.com>wrote:
> Hi Rick,
>
> should I make a Jira for that?
>
> Cheers,
>
> John
>
> > -----Original Message-----
> > From: Rick Curtis [mailto:curtisr7@gmail.com]
> > Sent: Thursday, October 10, 2013 2:53 PM
> > To: users
> > Subject: Re: Initialization Errors when unsing multiple PersistenceUnis
> in
> > persistence.xml
> >
> > > Is there a reason that we need to process persistence-unit definitions
> > which are not requested?
> > The DynamicEnhancementAgent was added as a feature to assist 'new' users
> > get up and running with minimal effort. Unfortunately this feature
> wasn't/isn't
> > 100% solid, and this is clearly a bug. In the event that an invalid PU is
> > encountered, a message should be logged and the error should be
> tolerated.
> >
> > I would advise setting the DynamicEnhancementAgent to false to avoid this
> > bug, and obviously you're enhancing via another method.
> >
> > Thanks,
> > Rick
> >
> >
> > On Thu, Oct 10, 2013 at 2:33 AM, Boblitz John
> > <jo...@bertschi.com>wrote:
> >
> > > Hello,
> > >
> > > I have a rather "simple" system configuration and wanted to simplify
> > > my persistence configuration by adding persistence-unit defintions to
> > > the persistence.xml. I basically have one pu definition for each
> > > environment (dev/tst/prd).
> > >
> > > On each system, there are several services which use the same pu
> > > definition but have their own instance of the pu. These communicate
> > > with each other via activeMQ to keep the caches in synch.
> > >
> > > Until now, I had one PU and in each service/environment the
> > > persistence configuration was included in a conf file and passed to
> the emf.
> > >
> > > The multiple pu's work just fine, as long as there is no error in ANY
> > > of them.
> > >
> > > However, if ANY one of the pu's has an error in the
> > > RemoteCommitProvider definition - jpa will not start.
> > >
> > > This occurs in the PCEnhancerAgent.registerClassLoadEnhancer which
> > > appears to loop over each pu and create a OpenJPAConfigurationImpl.
> > > In the loop the
> > > instantiateAll() method is invoked on each conf - whether I wanted to
> > > load that pu or not! - that in tune causes the RemoteCommitProvider to
> > > be created ...
> > >
> > > IF, when starting my development environment, the test environment is
> > > not online (or reachable) the start will fail.
> > >
> > >
> > > Is there a reason that we need to process persistence-unit definitions
> > > which are not requested?
> > >
> > > Setting DynamicEnhancementAgent to false resolves the problem ....
> > >
> > >
> > >
> > > John
> > > ----
> > > Who is General Failure, and why is he reading my hard disk?
> > >
> > >
> > >
> >
> >
> > --
> > *Rick Curtis*
>
--
*Rick Curtis*
RE: Initialization Errors when unsing multiple PersistenceUnis in
persistence.xml
Posted by Boblitz John <jo...@bertschi.com>.
Hi Rick,
should I make a Jira for that?
Cheers,
John
> -----Original Message-----
> From: Rick Curtis [mailto:curtisr7@gmail.com]
> Sent: Thursday, October 10, 2013 2:53 PM
> To: users
> Subject: Re: Initialization Errors when unsing multiple PersistenceUnis in
> persistence.xml
>
> > Is there a reason that we need to process persistence-unit definitions
> which are not requested?
> The DynamicEnhancementAgent was added as a feature to assist 'new' users
> get up and running with minimal effort. Unfortunately this feature wasn't/isn't
> 100% solid, and this is clearly a bug. In the event that an invalid PU is
> encountered, a message should be logged and the error should be tolerated.
>
> I would advise setting the DynamicEnhancementAgent to false to avoid this
> bug, and obviously you're enhancing via another method.
>
> Thanks,
> Rick
>
>
> On Thu, Oct 10, 2013 at 2:33 AM, Boblitz John
> <jo...@bertschi.com>wrote:
>
> > Hello,
> >
> > I have a rather "simple" system configuration and wanted to simplify
> > my persistence configuration by adding persistence-unit defintions to
> > the persistence.xml. I basically have one pu definition for each
> > environment (dev/tst/prd).
> >
> > On each system, there are several services which use the same pu
> > definition but have their own instance of the pu. These communicate
> > with each other via activeMQ to keep the caches in synch.
> >
> > Until now, I had one PU and in each service/environment the
> > persistence configuration was included in a conf file and passed to the emf.
> >
> > The multiple pu's work just fine, as long as there is no error in ANY
> > of them.
> >
> > However, if ANY one of the pu's has an error in the
> > RemoteCommitProvider definition - jpa will not start.
> >
> > This occurs in the PCEnhancerAgent.registerClassLoadEnhancer which
> > appears to loop over each pu and create a OpenJPAConfigurationImpl.
> > In the loop the
> > instantiateAll() method is invoked on each conf - whether I wanted to
> > load that pu or not! - that in tune causes the RemoteCommitProvider to
> > be created ...
> >
> > IF, when starting my development environment, the test environment is
> > not online (or reachable) the start will fail.
> >
> >
> > Is there a reason that we need to process persistence-unit definitions
> > which are not requested?
> >
> > Setting DynamicEnhancementAgent to false resolves the problem ....
> >
> >
> >
> > John
> > ----
> > Who is General Failure, and why is he reading my hard disk?
> >
> >
> >
>
>
> --
> *Rick Curtis*
Re: Initialization Errors when unsing multiple PersistenceUnis in persistence.xml
Posted by Rick Curtis <cu...@gmail.com>.
> Is there a reason that we need to process persistence-unit definitions
which are not requested?
The DynamicEnhancementAgent was added as a feature to assist 'new' users
get up and running with minimal effort. Unfortunately this feature
wasn't/isn't 100% solid, and this is clearly a bug. In the event that an
invalid PU is encountered, a message should be logged and the error should
be tolerated.
I would advise setting the DynamicEnhancementAgent to false to avoid this
bug, and obviously you're enhancing via another method.
Thanks,
Rick
On Thu, Oct 10, 2013 at 2:33 AM, Boblitz John <jo...@bertschi.com>wrote:
> Hello,
>
> I have a rather "simple" system configuration and wanted to simplify my
> persistence configuration by adding
> persistence-unit defintions to the persistence.xml. I basically have one
> pu definition for each environment (dev/tst/prd).
>
> On each system, there are several services which use the same pu
> definition but have their own instance of the pu. These communicate with
> each other
> via activeMQ to keep the caches in synch.
>
> Until now, I had one PU and in each service/environment the persistence
> configuration was included in a conf file and passed to the emf.
>
> The multiple pu's work just fine, as long as there is no error in ANY of
> them.
>
> However, if ANY one of the pu's has an error in the RemoteCommitProvider
> definition - jpa will not start.
>
> This occurs in the PCEnhancerAgent.registerClassLoadEnhancer which appears
> to loop over each pu and create a OpenJPAConfigurationImpl. In the loop the
> instantiateAll() method is invoked on each conf - whether I wanted to load
> that pu or not! - that in tune causes the RemoteCommitProvider to be
> created ...
>
> IF, when starting my development environment, the test environment is not
> online (or reachable) the start will fail.
>
>
> Is there a reason that we need to process persistence-unit definitions
> which are not requested?
>
> Setting DynamicEnhancementAgent to false resolves the problem ....
>
>
>
> John
> ----
> Who is General Failure, and why is he reading my hard disk?
>
>
>
--
*Rick Curtis*