From dev-return-5821-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Wed Aug 22 20:15:39 2007 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 39411 invoked from network); 22 Aug 2007 20:15:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Aug 2007 20:15:36 -0000 Received: (qmail 52117 invoked by uid 500); 22 Aug 2007 20:15:32 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 52085 invoked by uid 500); 22 Aug 2007 20:15:32 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 52072 invoked by uid 99); 22 Aug 2007 20:15:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Aug 2007 13:15:32 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kwsutter@gmail.com designates 209.85.128.185 as permitted sender) Received: from [209.85.128.185] (HELO fk-out-0910.google.com) (209.85.128.185) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Aug 2007 20:15:32 +0000 Received: by fk-out-0910.google.com with SMTP id z22so280531fkz for ; Wed, 22 Aug 2007 13:15:10 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Nem40Lm6x+Szs2310npRAOxsdKBhHs0E5bNkVMsSTvXnWk/AsuEpT6DWTpYxVdR5dPNNokU/5tUMvjfqZuPQfVHHBdLaurBYIMO1uGMBshyOBlEcaW1PFr3FTRvHAv1D0bjpKC6wqHySa0q85dvM5ScHU0kwURJaJlyHSPK/hBA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=t4Z0KXg047EUtX8kyJMAkNIplxfp1rU/TCcrkq6N0aBTbBSp8evsaTZKCXpQyCG7beQ/gWx3Kax1VynNP/iPM9OI+vilExSdUkBXD+sayGioUei6Ni+8CIq6cSMR7vEy1NIAH/bPTZ+TpltmwzxO8fL9S3yZUUTgr7JB1ArsYVo= Received: by 10.82.108.9 with SMTP id g9mr2242165buc.1187813708499; Wed, 22 Aug 2007 13:15:08 -0700 (PDT) Received: by 10.82.176.19 with HTTP; Wed, 22 Aug 2007 13:15:08 -0700 (PDT) Message-ID: <89c0c52c0708221315h4a20f80dk54887dc2af1e4a84@mail.gmail.com> Date: Wed, 22 Aug 2007 15:15:08 -0500 From: "Kevin Sutter" To: dev@openjpa.apache.org Subject: Re: Problems migrating to 1.0 In-Reply-To: <7262f25e0708221304o3536fftb6c2168c699986ed@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_106901_18220501.1187813708439" References: <3f5f9f310708212207l3ce9d759vb7efa20ca559ae9f@mail.gmail.com> <7262f25e0708220956p64575e7g30034abf4486e1c2@mail.gmail.com> <89c0c52c0708221014u7ca44b75lc24122b5e1539a38@mail.gmail.com> <7262f25e0708221042q5938eb89tc2690f8c954bbb1b@mail.gmail.com> <7262f25e0708221052k24c992yeb31cbb1afe4d723@mail.gmail.com> <89c0c52c0708221201m6c278192o144a6ac8d3e0150f@mail.gmail.com> <89c0c52c0708221202h21373eaei4e70005ddc006806@mail.gmail.com> <7262f25e0708221216u7fc2b451s2a8744f2bce9b6c2@mail.gmail.com> <89c0c52c0708221255x404ec05s4a33285efd8d2863@mail.gmail.com> <7262f25e0708221304o3536fftb6c2168c699986ed@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_106901_18220501.1187813708439 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Got it now. Thanks. I read your previous reply too quickly and didn't see that you had qualified the openjpa.RuntimeUnenhancedClasses as an OpenJPAConfiguration option. Thanks for the clarification. On 8/22/07, Patrick Linskey wrote: > > > > The settings are mostly-independent. The agent settings configure what > > > the agent is capable of; the configuration setting configures what the > > > system requires in terms of preconditions. > > > > > > It is possible to use ClassLoadEnhancement=true and > > > openjpa.RuntimeUnenhancedClasses=false, but it is not possible to > > > meaningfully use ClassLoadEnhancement=false and > > > openjpa.RuntimeUnenhancedClasses=false without first running the > > > enhancer. > > > > How many config options are we talking about? > > One option in OpenJPAConfiguration, and two (existing) options to be > specified for the javaagent. > > > Your first entry above > > indicated ClassLoadEnhancement and RuntimeRedefinition. But, your most > > recent reply only talked about ClassLoadEnhancement and > > RuntimeUnenhancedClasses. So, do we have two config options or three > > options? And, how do they relate to each other? > > ClassLoadEnhancement and RuntimeRedefinition are options for the > javaagent specification: > > java -javaagent:openjpa.jar=RuntimeRedefinition=true > ,ClassLoadEnhancement=false > ... > > openjpa.RuntimeUnenhancedClasses is a configuration option with three > possible options: supported, unsupported, and warn. > > When RuntimeUnenhancedClasses is set to unsupported or warn, the > developer must either run the enhancer or use the javaagent with > ClassLoadEnhancement=true (the default). This is the same as the > OpenJPA behavior two months ago. > > When RuntimeUnenhancedClasses is set to supported, OpenJPA can be used > without running the enhnacer or specifying a javaagent. > > It gets weird when you *do* specify a javaagent, with > ClassLoadEnhancement=false. This is really only there for testing > purposes, though, and is certainly not the normal behavior. > > -Patrick > > On 8/22/07, Kevin Sutter wrote: > > Indenting is getting a little hairy, but I'll try again... :-) > > > > On 8/22/07, Patrick Linskey wrote: > > > > > > Not too late -- I was just being optimistic. > > > > > > > > > 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? > > > > > > The settings are mostly-independent. The agent settings configure what > > > the agent is capable of; the configuration setting configures what the > > > system requires in terms of preconditions. > > > > > > It is possible to use ClassLoadEnhancement=true and > > > openjpa.RuntimeUnenhancedClasses=false, but it is not possible to > > > meaningfully use ClassLoadEnhancement=false and > > > openjpa.RuntimeUnenhancedClasses=false without first running the > > > enhancer. > > > > > > How many config options are we talking about? Your first entry above > > indicated ClassLoadEnhancement and RuntimeRedefinition. But, your most > > recent reply only talked about ClassLoadEnhancement and > > RuntimeUnenhancedClasses. So, do we have two config options or three > > options? And, how do they relate to each other? > > > > > > 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. > > > > > > The thing is that even if UnenhancedClasses were set to 'unsupported', > > > you could still skip enhancement if you ran with a javaagent that > > > enhanced on classloading, or if deploying into an appserver. > > > > > > I see your point. RuntimeUnenhancedClasses is fine with me (if we still > go > > with this config option based on my previous comment). > > > > Thanks! > > Kevin > > > > > > -Patrick > > > > > > On 8/22/07, Kevin Sutter wrote: > > > > Guess I was too late with my comments... you already integrated the > > > > changes... :-) > > > > > > > > On 8/22/07, Kevin Sutter wrote: > > > > > > > > > > Patrick, > > > > > > > > > > On 8/22/07, Patrick Linskey 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 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.CurrencygetCurrency(); > > > > > > > > > > public void setCurrency( > > > com.sample.accounts.entity.Currency); > > > > > > > > > > public > com.sample.accounts.entity.TaxRategetRelatedTax(); > > > > > > > > > > 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: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Patrick Linskey > > > 202 669 5907 > > > > > > > > -- > Patrick Linskey > 202 669 5907 > ------=_Part_106901_18220501.1187813708439--