openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sutter" <kwsut...@gmail.com>
Subject Re: Problems migrating to 1.0
Date Wed, 22 Aug 2007 19:02:57 GMT
Guess I was too late with my comments...  you already integrated the
changes...  :-)

On 8/22/07, Kevin Sutter <kwsutter@gmail.com> wrote:
>
> Patrick,
>
> On 8/22/07, Patrick Linskey <plinskey@gmail.com> wrote:
> >
> >
> > 1. change the javaagent settings to ClassLoadEnhancement and
> > RuntimeRedefinition (deprecate the RuntimeEnhancement setting, which
> > is exactly the same as ClassLoadEnhancement, except that the latter
> > better indicates the time that the enhancement happens)
>
>
> I think this sounds better.  The use of the two settings would definitely
> clarify what aspects of this support you want to enable.  My question is how
> would these two settings relate to each other?  Are they independent?  I
> suppose they could be.  These would be simple boolean settings?
>
> 2. change the conf setting to
> > RuntimeUnenhancedClasses=supported|unsupported|warn
>
>
> How about just UnenhancedClasses?  I suppose the Runtime prefix indicates
> when the extra processing would take place, but it would seem
> straightforward to indicate support or non-support of UnenhancedClasses.
>
> Kevin
>
> -Patrick
> >
> > On 8/22/07, Patrick Linskey < plinskey@gmail.com> wrote:
> > > > A couple of thoughts...  Could we come up with a different name for
> > this
> > > > configuration option.  RuntimeClassOptimization really is a
> > misnomer.  We're
> > > > not optimizing anything.  And, actually, the info messages that
> > might be
> > > > produced when using this support indicates that we're going to be
> > slower and
> > > > use more memory.  So, where's the optimization?  Maybe something
> > like
> > > > AutomaticRuntimeEnhancement or AutomaticPersistenceCapable or
> > > > RuntimeClassEnhancement or something along those lines.  I just
> > think we
> > > > need to remove the "Optimization" aspect.  We also need to be clear
> > that
> > > > this is different from the automatic agent or container classloading
> >
> > > > mechanisms.
> > >
> > > I used the word 'optimization' because as Marc pointed out to me, the
> > > enhancer is becoming a build-time optimization. However, I think that
> > > I agree that "optimization" might not be appropriate here.
> > >
> > > The thing is, "enhancement" isn't either, since this turns off the
> > > redefinition and subclassing capabilities.
> > >
> > > We could go the other direction, and say
> > > "BuildtimeClassEnhancement=required|optional|warn", but this doesn't
> > > really reflect the nature of the setting, since the setting controls
> > > not the build-time processes but the runtime requirements.
> > >
> > > > Now, getting back to your original question -- warning or error?  If
> > the
> > > > user has specified that they do not want this automatic enhancement
> > to take
> > > > place, then we should issue an error.  Or, are you thinking of
> > providing
> > > > multiple values for this setting:  true, warn (false), and error
> > (false)?  I
> > > > suppose that would work.
> > >
> > > I was thinking of changing it to "enabled", "disabled" (current
> > > behaviof for false), or "warn".
> > >
> > > > But, in general, either I want processing to take
> > > > place or I don't.
> > >
> > > That was my thought as well. However, given this new flakiness in the
> > > isAssignableFrom check, it doesn't seem that simple.
> > >
> > > >  And, looking at your code in ManagedClassSubclasser, it
> > > > looks like we are already issuing an informational message for all
> > of the
> > > > classes that fall into this processing.  So, isn't that similar to
> > the
> > > > warn(false) setting?
> > >
> > > In the error case, we throw an exception from ManagedClassSubclasser.
> > > In the new warn case, we warn and just return from the method. There
> > > will be a failure later, no doubt.
> > >
> > > > BTW, due to these potential problems and questions, does that mean
> > that Marc
> > > > has to respin?
> > >
> > > I think so, since it seems like the user has a fairly standard
> > > configuration (OpenJPA + Spring + Java 6).
> > >
> > > I'm going to check in something that uses a conf setting called
> > > 'RuntimeUnenhancedClassSupport". We might want to tweak this later,
> > > but it is very easy to provide backward-compat for simple config
> > > properties.
> > >
> > > -Patrick
> > >
> > > On 8/22/07, Kevin Sutter < kwsutter@gmail.com> wrote:
> > > > Patrick,
> > > >
> > > > On 8/22/07, Patrick Linskey <plinskey@gmail.com> wrote:
> > > > >
> > > > > Well, the only thing that I can think of is that there is some
> > sort of
> > > > > classloader confusion preventing the isAssignableFrom check to
> > pass.
> > > > > This would also potentially explain why the com.sun class is not
> > being
> > > > > found.
> > > >
> > > >
> > > > Could it also be related to something in the JDK 6
> > implementation?  We're
> > > > tracking a semi-related problem on iSeries and one of the possible
> > points of
> > > > failure is the isAssignableFrom.  But, it's just a guess at this
> > point.
> > > >
> > > > I think that maybe it makes sense to change the new configuration
> > > > > option to allow the user to select between a warning and an error.
> >
> > > > > Thoughts?
> > > >
> > > >
> > > > A couple of thoughts...  Could we come up with a different name for
> > this
> > > > configuration option.  RuntimeClassOptimization really is a
> > misnomer.  We're
> > > > not optimizing anything.  And, actually, the info messages that
> > might be
> > > > produced when using this support indicates that we're going to be
> > slower and
> > > > use more memory.  So, where's the optimization?  Maybe something
> > like
> > > > AutomaticRuntimeEnhancement or AutomaticPersistenceCapable or
> > > > RuntimeClassEnhancement or something along those lines.  I just
> > think we
> > > > need to remove the "Optimization" aspect.  We also need to be clear
> > that
> > > > this is different from the automatic agent or container classloading
> > > > mechanisms.
> > > >
> > > > Now, getting back to your original question -- warning or error?  If
> > the
> > > > user has specified that they do not want this automatic enhancement
> > to take
> > > > place, then we should issue an error.  Or, are you thinking of
> > providing
> > > > multiple values for this setting:  true, warn (false), and error
> > (false)?  I
> > > > suppose that would work.  But, in general, either I want processing
> > to take
> > > > place or I don't.  And, looking at your code in
> > ManagedClassSubclasser, it
> > > > looks like we are already issuing an informational message for all
> > of the
> > > > classes that fall into this processing.  So, isn't that similar to
> > the
> > > > warn(false) setting?
> > > >
> > > > BTW, due to these potential problems and questions, does that mean
> > that Marc
> > > > has to respin?
> > > >
> > > > Kevin
> > > >
> > > > -Patrick
> > > > >
> > > > > On 8/22/07, Prashant Bhat < prashant.mr@gmail.com> wrote:
> > > > > > Here is the output of javap run on one of the entity.
> > > > > >
> > > > > > public class com.sample.accounts.entity.Account extends
> > > > > > com.sample.company.base.CompanyEntity implements org.apache.op
> > > > > > enjpa.enhance.PersistenceCapable{
> > > > > >     static java.lang.Classclass$Lcom$sample$company$base$CompanyEntity;
> > > > > >     static java.lang.Class class$Ljava$lang$String;
> > > > > >     static
> > java.lang.Classclass$Lcom$sample$accounts$entity$AccountType ;
> > > > > >     static
> > java.lang.Classclass$Lcom$sample$company$entity$BusinessPartner;
> > > > > >     static java.lang.Classclass$Lcom$sample$accounts$entity$Currency;
> > > > > >     static java.lang.Class class$Ljava$math$BigDecimal;
> > > > > >     static java.lang.Classclass$Lcom$sample$accounts$entity$Account;
> > > > > >     static java.lang.Classclass$Lcom$sample$accounts$entity$TaxRate;
> > > > > >     public com.sample.accounts.entity.Account ();
> > > > > >     public com.sample.accounts.entity.Account(long,
> > java.lang.String,
> > > > > > java.lang.String, com.sample.accounts.entity.Acc
> > > > > > ountType, java.math.BigDecimal);
> > > > > >     public long getId();
> > > > > >     public void setId(long);
> > > > > >     public java.lang.String getName();
> > > > > >     public void setName(java.lang.String);
> > > > > >     public java.lang.String getDescription();
> > > > > >     public void setDescription(java.lang.String);
> > > > > >     public java.lang.String getAccountNumber();
> > > > > >     public void setAccountNumber(java.lang.String);
> > > > > >     public com.sample.accounts.entity.Currency getCurrency();
> > > > > >     public void setCurrency( com.sample.accounts.entity.Currency);
> > > > > >     public com.sample.accounts.entity.TaxRate getRelatedTax();
> > > > > >     public void setRelatedTax(com.sample.accounts.entity.TaxRate
> > );
> > > > > >     public com.sample.accounts.entity.AccountgetParentAccount();
> > > > > >     public void setParentAccount(
> > com.sample.accounts.entity.Account);
> > > > > >     public com.sample.accounts.entity.AccountTypegetAccountType();
> > > > > >     public void setAccountType(
> > com.sample.accounts.entity.AccountType );
> > > > > >     public
> > com.samooha.company.entity.BusinessPartnergetBusinessPartner();
> > > > > >     public void setBusinessPartner(
> > > > > com.sample.company.entity.BusinessPartner
> > > > > > );
> > > > > >     public boolean isPostable();
> > > > > >     public void setPostable(boolean);
> > > > > >     public int getSequenceNumber();
> > > > > >     public void setSequenceNumber(int);
> > > > > >     public boolean isSplitAccount();
> > > > > >     public void setSplitAccount(boolean);
> > > > > >     public boolean isGroupingAccount();
> > > > > >     public void setGroupingAccount(boolean);
> > > > > >     public java.math.BigDecimal getCurrentBalance();
> > > > > >     public void setCurrentBalance(java.math.BigDecimal );
> > > > > >     public int pcGetEnhancementContractVersion();
> > > > > >     static final {};
> > > > > >     static java.lang.Class class$(java.lang.String);
> > > > > >     protected void pcClearFields();
> > > > > >     public org.apache.openjpa.enhance.PersistenceCapablepcNewInstance(
> > > > > > org.apache.openjpa.enhance.StateManager, java.lan
> > > > > > g.Object, boolean);
> > > > > >     public org.apache.openjpa.enhance.PersistenceCapablepcNewInstance(
> > > > > > org.apache.openjpa.enhance.StateManager , boolean)
> > > > > > ;
> > > > > >     protected static int pcGetManagedFieldCount();
> > > > > >     public void pcReplaceField(int);
> > > > > >     public void pcReplaceFields(int[]);
> > > > > >     public void pcProvideField(int);
> > > > > >     public void pcProvideFields(int[]);
> > > > > >     protected void pcCopyField(
> > com.sample.accounts.entity.Account, int);
> > > > > >     public void pcCopyFields(java.lang.Object, int[]);
> > > > > >     public void pcCopyKeyFieldsToObjectId(
> > > > > > org.apache.openjpa.enhance.FieldSupplier, java.lang.Object);
> > > > > >     public void pcCopyKeyFieldsToObjectId(java.lang.Object);
> > > > > >     public void pcCopyKeyFieldsFromObjectId(
> > > > > > org.apache.openjpa.enhance.FieldConsumer , java.lang.Object);
> > > > > >     public void pcCopyKeyFieldsFromObjectId(java.lang.Object);
> > > > > >     public java.lang.Object pcNewObjectIdInstance(
> > java.lang.Object);
> > > > > >     public java.lang.Object pcNewObjectIdInstance();
> > > > > > }
> > > > > >
> > > > > >
> > > > > > As from the above output, it is enhanced properly, but I still
> > get the
> > > > > > following exception:
> > > > > >
> > > > > > <openjpa-0.0.0-r420667:568385 nonfatal user error>
> > > > > > org.apache.openjpa.persistence.ArgumentException : This
> > configuration
> > > > > > disallows runtime optimization, but the following listed types
> > were not
> > > > > > enhanced at build time or at class load time with a javaagent:
> > "[..]".
> > > > > >     at
> > > > > >
> > > > >
> > org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses
> > (
> > > > > > ManagedClassSubclasser.java:90)
> > > > > >
> > > > > > Thanks,
> > > > > > Prashant.
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Patrick Linskey
> > > > > 202 669 5907
> > > > >
> > > >
> > >
> > >
> > > --
> > > Patrick Linskey
> > > 202 669 5907
> > >
> >
> >
> > --
> > Patrick Linskey
> > 202 669 5907
> >
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message