You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Kevin Sutter <kw...@gmail.com> on 2007/07/31 21:50:26 UTC

Non-enhancement of Entities (OPENJPA-293) questions

Patrick,
I haven't had the time to study all of your proposed changes for OPENJPA-293
and the related Issues, but I was wondering if you could enlighten my on a
couple of topics...

1)  How does this automatic persistence-capable feature mesh with the
automatic container enhancement of Entities?  That is, I would hope that if
an application server (ie. Container) is in the picture, then this new
automatic persistence-capable feature stays dormant.  I wouldn't want to
attempt to mix these two environments.  If the container misses the
enhancement of an Entity (due to a bug or something), I wouldn't want this
new feature to kick in and possibly confuse the runtime environment of the
container and the associated OpenJPA runtime.

2)  Is there a means to turn off this new feature?  For example, suppose I
have an existing OpenJPA environment where I am either statically or
dynamically enhancing the Entities and I'm happy with this setup.  But, then
I upgrade to a new version of OpenJPA with this new automatic
persistence-capable feature and I start to get difficult-to-diagnose
problems because some of my classes were pre-enhanced while others used this
new feature.  I would like the ability to turn off this new feature if I
wish to run solely with the enhancement mechanism.

3)  To that end, I would assume that this new automatic persistence-capable
feature is the default action since we want the out-of-the-box experience to
be as easy as possible.

4)  What are we going to call this new automatic persistence-capable
feature?  :-)  I think we were just getting our users (existing and
potential) used to the "enhancement" concept and now we're throwing in a new
wrinkle.  Maybe you've already nicknamed the support.  I just couldn't find
a reference to it.

Thanks,
Kevin

Re: Non-enhancement of Entities (OPENJPA-293) questions

Posted by Patrick Linskey <pl...@gmail.com>.
> Hmmm... I don't think I like this.  Even if the container enhancement of the
> Entities would override the automatic PC proxies, the automatic PC would
> just be extra overhead that would not be required.  I would think that we
> would not want this automatic PC feature to be in effect when we are running
> with the container managed environment.  Am I missing something that would
> make this extra processing desirable?

Not that I know of, no.

FWIW, note that it's only a cost at BrokerFactory construction time.

-Patrick

On 7/31/07, Kevin Sutter <kw...@gmail.com> wrote:
> Thanks, Patrick.  More comments below...
>
> > 1)  How does this automatic persistence-capable feature mesh with the
>
> > > automatic container enhancement of Entities?  That is, I would hope that
> > if
> > > an application server (ie. Container) is in the picture, then this new
> > > automatic persistence-capable feature stays dormant.
> >
> > Currently, the automatic PC work will happen first in a Java EE 5
> > environment.
>
>
> Hmmm... I don't think I like this.  Even if the container enhancement of the
> Entities would override the automatic PC proxies, the automatic PC would
> just be extra overhead that would not be required.  I would think that we
> would not want this automatic PC feature to be in effect when we are running
> with the container managed environment.  Am I missing something that would
> make this extra processing desirable?
>
> > I wouldn't want to
> > > attempt to mix these two environments.  If the container misses the
> > > enhancement of an Entity (due to a bug or something), I wouldn't want
> > this
> > > new feature to kick in and possibly confuse the runtime environment of
> > the
> > > container and the associated OpenJPA runtime.
> >
> > I didn't put any code in place that disables this hybrid mode. It's
> > definitely doable, though.
>
>
> Okay.  Might need that per my earlier comment.
>
> > 2)  Is there a means to turn off this new feature?  For example, suppose I
> > > have an existing OpenJPA environment where I am either statically or
> > > dynamically enhancing the Entities and I'm happy with this setup.  But,
> > then
> > > I upgrade to a new version of OpenJPA with this new automatic
> > > persistence-capable feature and I start to get difficult-to-diagnose
> > > problems because some of my classes were pre-enhanced while others used
> > this
> > > new feature.  I would like the ability to turn off this new feature if I
> > > wish to run solely with the enhancement mechanism.
> >
> > I can't think of any environment in which only enhancing some classes
> > would cause a problem. However, yes, the feature can be turned off, by
> > specifying a javaagent with the flags set appropriately.
> >
> > We could add a configuration option that would influence both this and
> > your point #1.
>
>
> Sounds good.  I think we need this to be configurable.
>
> > 3)  To that end, I would assume that this new automatic
> > persistence-capable
> > > feature is the default action since we want the out-of-the-box
> > experience to
> > > be as easy as possible.
> >
> > Yes, it's the default. The QoS that you get depends on the version of
> > Java that you're running; things will work better in Java SE 6, or in
> > Java SE 5 + a javaagent setting.
>
>
> Sounds good.
>
> > 4)  What are we going to call this new automatic persistence-capable
> > > feature?  :-)  I think we were just getting our users (existing and
> > > potential) used to the "enhancement" concept and now we're throwing in a
> > new
> > > wrinkle.  Maybe you've already nicknamed the support.  I just couldn't
> > find
> > > a reference to it.
> >
> > I haven't come up with a name, but I'm not convinced that we need one
> > in the long term. Instead, we need to change our docs etc. to make it
> > clear that enhancement is optional. (I've done some work to that end
> > already.) I'm open to suggestions, though.
>
>
> You're right.  It's the lack of the enhancement step that is the feature.  I
> guess I was thinking more along the lines of what we were going to call it
> internally.  Maybe we just coined it "automatic pc"...  :-)
>
> Thanks for your quick reply!
> Kevin
>
> -Patrick
> >
> > On 7/31/07, Kevin Sutter <kw...@gmail.com> wrote:
> > > Patrick,
> > > I haven't had the time to study all of your proposed changes for
> > OPENJPA-293
> > > and the related Issues, but I was wondering if you could enlighten my on
> > a
> > > couple of topics...
> > >
> > > 1)  How does this automatic persistence-capable feature mesh with the
> > > automatic container enhancement of Entities?  That is, I would hope that
> > if
> > > an application server (ie. Container) is in the picture, then this new
> > > automatic persistence-capable feature stays dormant.  I wouldn't want to
> > > attempt to mix these two environments.  If the container misses the
> > > enhancement of an Entity (due to a bug or something), I wouldn't want
> > this
> > > new feature to kick in and possibly confuse the runtime environment of
> > the
> > > container and the associated OpenJPA runtime.
> > >
> > > 2)  Is there a means to turn off this new feature?  For example, suppose
> > I
> > > have an existing OpenJPA environment where I am either statically or
> > > dynamically enhancing the Entities and I'm happy with this setup.  But,
> > then
> > > I upgrade to a new version of OpenJPA with this new automatic
> > > persistence-capable feature and I start to get difficult-to-diagnose
> > > problems because some of my classes were pre-enhanced while others used
> > this
> > > new feature.  I would like the ability to turn off this new feature if I
> > > wish to run solely with the enhancement mechanism.
> > >
> > > 3)  To that end, I would assume that this new automatic
> > persistence-capable
> > > feature is the default action since we want the out-of-the-box
> > experience to
> > > be as easy as possible.
> > >
> > > 4)  What are we going to call this new automatic persistence-capable
> > > feature?  :-)  I think we were just getting our users (existing and
> > > potential) used to the "enhancement" concept and now we're throwing in a
> > new
> > > wrinkle.  Maybe you've already nicknamed the support.  I just couldn't
> > find
> > > a reference to it.
> > >
> > > Thanks,
> > > Kevin
> > >
> >
> >
> > --
> > Patrick Linskey
> > 202 669 5907
> >
>


-- 
Patrick Linskey
202 669 5907

Re: Non-enhancement of Entities (OPENJPA-293) questions

Posted by Kevin Sutter <kw...@gmail.com>.
Thanks, Patrick.  More comments below...

> 1)  How does this automatic persistence-capable feature mesh with the

> > automatic container enhancement of Entities?  That is, I would hope that
> if
> > an application server (ie. Container) is in the picture, then this new
> > automatic persistence-capable feature stays dormant.
>
> Currently, the automatic PC work will happen first in a Java EE 5
> environment.


Hmmm... I don't think I like this.  Even if the container enhancement of the
Entities would override the automatic PC proxies, the automatic PC would
just be extra overhead that would not be required.  I would think that we
would not want this automatic PC feature to be in effect when we are running
with the container managed environment.  Am I missing something that would
make this extra processing desirable?

> I wouldn't want to
> > attempt to mix these two environments.  If the container misses the
> > enhancement of an Entity (due to a bug or something), I wouldn't want
> this
> > new feature to kick in and possibly confuse the runtime environment of
> the
> > container and the associated OpenJPA runtime.
>
> I didn't put any code in place that disables this hybrid mode. It's
> definitely doable, though.


Okay.  Might need that per my earlier comment.

> 2)  Is there a means to turn off this new feature?  For example, suppose I
> > have an existing OpenJPA environment where I am either statically or
> > dynamically enhancing the Entities and I'm happy with this setup.  But,
> then
> > I upgrade to a new version of OpenJPA with this new automatic
> > persistence-capable feature and I start to get difficult-to-diagnose
> > problems because some of my classes were pre-enhanced while others used
> this
> > new feature.  I would like the ability to turn off this new feature if I
> > wish to run solely with the enhancement mechanism.
>
> I can't think of any environment in which only enhancing some classes
> would cause a problem. However, yes, the feature can be turned off, by
> specifying a javaagent with the flags set appropriately.
>
> We could add a configuration option that would influence both this and
> your point #1.


Sounds good.  I think we need this to be configurable.

> 3)  To that end, I would assume that this new automatic
> persistence-capable
> > feature is the default action since we want the out-of-the-box
> experience to
> > be as easy as possible.
>
> Yes, it's the default. The QoS that you get depends on the version of
> Java that you're running; things will work better in Java SE 6, or in
> Java SE 5 + a javaagent setting.


Sounds good.

> 4)  What are we going to call this new automatic persistence-capable
> > feature?  :-)  I think we were just getting our users (existing and
> > potential) used to the "enhancement" concept and now we're throwing in a
> new
> > wrinkle.  Maybe you've already nicknamed the support.  I just couldn't
> find
> > a reference to it.
>
> I haven't come up with a name, but I'm not convinced that we need one
> in the long term. Instead, we need to change our docs etc. to make it
> clear that enhancement is optional. (I've done some work to that end
> already.) I'm open to suggestions, though.


You're right.  It's the lack of the enhancement step that is the feature.  I
guess I was thinking more along the lines of what we were going to call it
internally.  Maybe we just coined it "automatic pc"...  :-)

Thanks for your quick reply!
Kevin

-Patrick
>
> On 7/31/07, Kevin Sutter <kw...@gmail.com> wrote:
> > Patrick,
> > I haven't had the time to study all of your proposed changes for
> OPENJPA-293
> > and the related Issues, but I was wondering if you could enlighten my on
> a
> > couple of topics...
> >
> > 1)  How does this automatic persistence-capable feature mesh with the
> > automatic container enhancement of Entities?  That is, I would hope that
> if
> > an application server (ie. Container) is in the picture, then this new
> > automatic persistence-capable feature stays dormant.  I wouldn't want to
> > attempt to mix these two environments.  If the container misses the
> > enhancement of an Entity (due to a bug or something), I wouldn't want
> this
> > new feature to kick in and possibly confuse the runtime environment of
> the
> > container and the associated OpenJPA runtime.
> >
> > 2)  Is there a means to turn off this new feature?  For example, suppose
> I
> > have an existing OpenJPA environment where I am either statically or
> > dynamically enhancing the Entities and I'm happy with this setup.  But,
> then
> > I upgrade to a new version of OpenJPA with this new automatic
> > persistence-capable feature and I start to get difficult-to-diagnose
> > problems because some of my classes were pre-enhanced while others used
> this
> > new feature.  I would like the ability to turn off this new feature if I
> > wish to run solely with the enhancement mechanism.
> >
> > 3)  To that end, I would assume that this new automatic
> persistence-capable
> > feature is the default action since we want the out-of-the-box
> experience to
> > be as easy as possible.
> >
> > 4)  What are we going to call this new automatic persistence-capable
> > feature?  :-)  I think we were just getting our users (existing and
> > potential) used to the "enhancement" concept and now we're throwing in a
> new
> > wrinkle.  Maybe you've already nicknamed the support.  I just couldn't
> find
> > a reference to it.
> >
> > Thanks,
> > Kevin
> >
>
>
> --
> Patrick Linskey
> 202 669 5907
>

Re: Non-enhancement of Entities (OPENJPA-293) questions

Posted by Patrick Linskey <pl...@gmail.com>.
> 1)  How does this automatic persistence-capable feature mesh with the
> automatic container enhancement of Entities?  That is, I would hope that if
> an application server (ie. Container) is in the picture, then this new
> automatic persistence-capable feature stays dormant.

Currently, the automatic PC work will happen first in a Java EE 5 environment.

> I wouldn't want to
> attempt to mix these two environments.  If the container misses the
> enhancement of an Entity (due to a bug or something), I wouldn't want this
> new feature to kick in and possibly confuse the runtime environment of the
> container and the associated OpenJPA runtime.

I didn't put any code in place that disables this hybrid mode. It's
definitely doable, though.

> 2)  Is there a means to turn off this new feature?  For example, suppose I
> have an existing OpenJPA environment where I am either statically or
> dynamically enhancing the Entities and I'm happy with this setup.  But, then
> I upgrade to a new version of OpenJPA with this new automatic
> persistence-capable feature and I start to get difficult-to-diagnose
> problems because some of my classes were pre-enhanced while others used this
> new feature.  I would like the ability to turn off this new feature if I
> wish to run solely with the enhancement mechanism.

I can't think of any environment in which only enhancing some classes
would cause a problem. However, yes, the feature can be turned off, by
specifying a javaagent with the flags set appropriately.

We could add a configuration option that would influence both this and
your point #1.

> 3)  To that end, I would assume that this new automatic persistence-capable
> feature is the default action since we want the out-of-the-box experience to
> be as easy as possible.

Yes, it's the default. The QoS that you get depends on the version of
Java that you're running; things will work better in Java SE 6, or in
Java SE 5 + a javaagent setting.

> 4)  What are we going to call this new automatic persistence-capable
> feature?  :-)  I think we were just getting our users (existing and
> potential) used to the "enhancement" concept and now we're throwing in a new
> wrinkle.  Maybe you've already nicknamed the support.  I just couldn't find
> a reference to it.

I haven't come up with a name, but I'm not convinced that we need one
in the long term. Instead, we need to change our docs etc. to make it
clear that enhancement is optional. (I've done some work to that end
already.) I'm open to suggestions, though.

-Patrick

On 7/31/07, Kevin Sutter <kw...@gmail.com> wrote:
> Patrick,
> I haven't had the time to study all of your proposed changes for OPENJPA-293
> and the related Issues, but I was wondering if you could enlighten my on a
> couple of topics...
>
> 1)  How does this automatic persistence-capable feature mesh with the
> automatic container enhancement of Entities?  That is, I would hope that if
> an application server (ie. Container) is in the picture, then this new
> automatic persistence-capable feature stays dormant.  I wouldn't want to
> attempt to mix these two environments.  If the container misses the
> enhancement of an Entity (due to a bug or something), I wouldn't want this
> new feature to kick in and possibly confuse the runtime environment of the
> container and the associated OpenJPA runtime.
>
> 2)  Is there a means to turn off this new feature?  For example, suppose I
> have an existing OpenJPA environment where I am either statically or
> dynamically enhancing the Entities and I'm happy with this setup.  But, then
> I upgrade to a new version of OpenJPA with this new automatic
> persistence-capable feature and I start to get difficult-to-diagnose
> problems because some of my classes were pre-enhanced while others used this
> new feature.  I would like the ability to turn off this new feature if I
> wish to run solely with the enhancement mechanism.
>
> 3)  To that end, I would assume that this new automatic persistence-capable
> feature is the default action since we want the out-of-the-box experience to
> be as easy as possible.
>
> 4)  What are we going to call this new automatic persistence-capable
> feature?  :-)  I think we were just getting our users (existing and
> potential) used to the "enhancement" concept and now we're throwing in a new
> wrinkle.  Maybe you've already nicknamed the support.  I just couldn't find
> a reference to it.
>
> Thanks,
> Kevin
>


-- 
Patrick Linskey
202 669 5907