You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Craig L Russell <Cr...@Sun.COM> on 2007/03/01 07:41:51 UTC

Re: svn commit: r513183 - in /incubator/openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/conf/ openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ openjpa-persistence/src/main/java/org/apache/openjpa/persistence/

Hi Patrick,

I don't quite understand the code that follows. What is the  
difference between this code and simply defaulting the value to non- 
finalizing impl?

Craig

On Feb 28, 2007, at 10:31 PM, pcl@apache.org wrote:

>          PersistenceUnitInfo pui, Map m) {
>          PersistenceProductDerivation pd = new  
> PersistenceProductDerivation();
>          try {
> +            // if the BrokerImpl hasn't been specified, switch to the
> +            // non-finalizing one, since anything claiming to be a  
> container
> +            // should be doing proper resource management.
> +            if (!Configurations.containsProperty(BrokerValue.KEY,
> +                pui.getProperties())
> +                && !Configurations.containsProperty 
> (BrokerValue.KEY, m)) {
> +                m.put(BrokerValue.KEY,  
> BrokerValue.NON_FINALIZING_ALIAS);
> +            }
> +
>              ConfigurationProvider cp = pd.load(pui, m);
>              if (cp == null)
>                  return null;

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Re: svn commit: r513183 - in /incubator/openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/conf/ openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ openjpa-persistence/src/main/java/org/apache/openjpa/persistence/

Posted by Craig L Russell <Cr...@Sun.COM>.
On Mar 1, 2007, at 11:01 AM, Patrick Linskey wrote:

> The diff email didn't include enough context for you. This is in the
> createContainerEntityManagerFactory() method. It's my contention that
> createContainerEntityManagerFactory() will only be invoked by things
> that intend to close resources properly.

Cool. Thanks,

Craig
>
> -Patrick
>
> --  
> Patrick Linskey
> BEA Systems, Inc.
>
> ______________________________________________________________________ 
> _
> Notice:  This email message, together with any attachments, may  
> contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and   
> affiliated
> entities,  that may be confidential,  proprietary,  copyrighted   
> and/or
> legally privileged, and is intended solely for the use of the  
> individual
> or entity named in this message. If you are not the intended  
> recipient,
> and have received this message in error, please immediately return  
> this
> by email and then delete it.
>
>> -----Original Message-----
>> From: Craig.Russell@Sun.COM [mailto:Craig.Russell@Sun.COM]
>> Sent: Thursday, March 01, 2007 10:38 AM
>> To: open-jpa-dev@incubator.apache.org
>> Subject: Re: svn commit: r513183 - in
>> /incubator/openjpa/trunk:
>> openjpa-kernel/src/main/java/org/apache/openjpa/conf/
>> openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/
>> openjpa-persistence/src/main/java/org/apache/openjpa/persistence/
>>
>> Hi Patrick,
>>
>> I'm trying to understand how the code knows it's running in an
>> appserver environment...
>>
>> Thanks,
>>
>> Craig
>>
>> On Mar 1, 2007, at 7:52 AM, Patrick Linskey wrote:
>>
>>> The difference is that in an appserver environment, this
>> will return a
>>> non-finalizing EM by default, but in a Java SE environment, it will
>>> return a finalizing EM by default. See the last bit of my
>> last comment
>>> in OPENJPA-160.
>>>
>>> -Patrick
>>>
>>> -- 
>>> Patrick Linskey
>>> BEA Systems, Inc.
>>>
>>>
>> ______________________________________________________________
>> ________
>>> _
>>> Notice:  This email message, together with any attachments, may
>>> contain
>>> information  of  BEA Systems,  Inc.,  its subsidiaries  and
>>> affiliated
>>> entities,  that may be confidential,  proprietary,  copyrighted
>>> and/or
>>> legally privileged, and is intended solely for the use of the
>>> individual
>>> or entity named in this message. If you are not the intended
>>> recipient,
>>> and have received this message in error, please immediately return
>>> this
>>> by email and then delete it.
>>>
>>>> -----Original Message-----
>>>> From: Craig.Russell@Sun.COM [mailto:Craig.Russell@Sun.COM]
>>>> Sent: Wednesday, February 28, 2007 10:42 PM
>>>> To: open-jpa-dev@incubator.apache.org
>>>> Subject: Re: svn commit: r513183 - in
>>>> /incubator/openjpa/trunk:
>>>> openjpa-kernel/src/main/java/org/apache/openjpa/conf/
>>>> openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/
>>>> openjpa-persistence/src/main/java/org/apache/openjpa/persistence/
>>>>
>>>> Hi Patrick,
>>>>
>>>> I don't quite understand the code that follows. What is the
>>>> difference between this code and simply defaulting the
>> value to non-
>>>> finalizing impl?
>>>>
>>>> Craig
>>>>
>>>> On Feb 28, 2007, at 10:31 PM, pcl@apache.org wrote:
>>>>
>>>>>          PersistenceUnitInfo pui, Map m) {
>>>>>          PersistenceProductDerivation pd = new
>>>>> PersistenceProductDerivation();
>>>>>          try {
>>>>> +            // if the BrokerImpl hasn't been specified,
>>>> switch to the
>>>>> +            // non-finalizing one, since anything claiming
>>>> to be a
>>>>> container
>>>>> +            // should be doing proper resource management.
>>>>> +            if (!Configurations.containsProperty(BrokerValue.KEY,
>>>>> +                pui.getProperties())
>>>>> +                && !Configurations.containsProperty
>>>>> (BrokerValue.KEY, m)) {
>>>>> +                m.put(BrokerValue.KEY,
>>>>> BrokerValue.NON_FINALIZING_ALIAS);
>>>>> +            }
>>>>> +
>>>>>              ConfigurationProvider cp = pd.load(pui, m);
>>>>>              if (cp == null)
>>>>>                  return null;
>>>>
>>>> Craig Russell
>>>> Architect, Sun Java Enterprise System
>> http://java.sun.com/products/
>>>> jdo
>>>> 408 276-5638 mailto:Craig.Russell@sun.com
>>>> P.S. A good JDO? O, Gasp!
>>>>
>>>>
>>
>> Craig Russell
>> Architect, Sun Java Enterprise System http://java.sun.com/products/ 
>> jdo
>> 408 276-5638 mailto:Craig.Russell@sun.com
>> P.S. A good JDO? O, Gasp!
>>
>>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


RE: svn commit: r513183 - in /incubator/openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/conf/ openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ openjpa-persistence/src/main/java/org/apache/openjpa/persistence/

Posted by Patrick Linskey <pl...@bea.com>.
The diff email didn't include enough context for you. This is in the
createContainerEntityManagerFactory() method. It's my contention that
createContainerEntityManagerFactory() will only be invoked by things
that intend to close resources properly.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Craig.Russell@Sun.COM [mailto:Craig.Russell@Sun.COM] 
> Sent: Thursday, March 01, 2007 10:38 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: svn commit: r513183 - in 
> /incubator/openjpa/trunk: 
> openjpa-kernel/src/main/java/org/apache/openjpa/conf/ 
> openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ 
> openjpa-persistence/src/main/java/org/apache/openjpa/persistence/
> 
> Hi Patrick,
> 
> I'm trying to understand how the code knows it's running in an  
> appserver environment...
> 
> Thanks,
> 
> Craig
> 
> On Mar 1, 2007, at 7:52 AM, Patrick Linskey wrote:
> 
> > The difference is that in an appserver environment, this 
> will return a
> > non-finalizing EM by default, but in a Java SE environment, it will
> > return a finalizing EM by default. See the last bit of my 
> last comment
> > in OPENJPA-160.
> >
> > -Patrick
> >
> > -- 
> > Patrick Linskey
> > BEA Systems, Inc.
> >
> > 
> ______________________________________________________________
> ________ 
> > _
> > Notice:  This email message, together with any attachments, may  
> > contain
> > information  of  BEA Systems,  Inc.,  its subsidiaries  and   
> > affiliated
> > entities,  that may be confidential,  proprietary,  copyrighted   
> > and/or
> > legally privileged, and is intended solely for the use of the  
> > individual
> > or entity named in this message. If you are not the intended  
> > recipient,
> > and have received this message in error, please immediately return  
> > this
> > by email and then delete it.
> >
> >> -----Original Message-----
> >> From: Craig.Russell@Sun.COM [mailto:Craig.Russell@Sun.COM]
> >> Sent: Wednesday, February 28, 2007 10:42 PM
> >> To: open-jpa-dev@incubator.apache.org
> >> Subject: Re: svn commit: r513183 - in
> >> /incubator/openjpa/trunk:
> >> openjpa-kernel/src/main/java/org/apache/openjpa/conf/
> >> openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/
> >> openjpa-persistence/src/main/java/org/apache/openjpa/persistence/
> >>
> >> Hi Patrick,
> >>
> >> I don't quite understand the code that follows. What is the
> >> difference between this code and simply defaulting the 
> value to non-
> >> finalizing impl?
> >>
> >> Craig
> >>
> >> On Feb 28, 2007, at 10:31 PM, pcl@apache.org wrote:
> >>
> >>>          PersistenceUnitInfo pui, Map m) {
> >>>          PersistenceProductDerivation pd = new
> >>> PersistenceProductDerivation();
> >>>          try {
> >>> +            // if the BrokerImpl hasn't been specified,
> >> switch to the
> >>> +            // non-finalizing one, since anything claiming
> >> to be a
> >>> container
> >>> +            // should be doing proper resource management.
> >>> +            if (!Configurations.containsProperty(BrokerValue.KEY,
> >>> +                pui.getProperties())
> >>> +                && !Configurations.containsProperty
> >>> (BrokerValue.KEY, m)) {
> >>> +                m.put(BrokerValue.KEY,
> >>> BrokerValue.NON_FINALIZING_ALIAS);
> >>> +            }
> >>> +
> >>>              ConfigurationProvider cp = pd.load(pui, m);
> >>>              if (cp == null)
> >>>                  return null;
> >>
> >> Craig Russell
> >> Architect, Sun Java Enterprise System 
> http://java.sun.com/products/ 
> >> jdo
> >> 408 276-5638 mailto:Craig.Russell@sun.com
> >> P.S. A good JDO? O, Gasp!
> >>
> >>
> 
> Craig Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
> 
> 

Re: svn commit: r513183 - in /incubator/openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/conf/ openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ openjpa-persistence/src/main/java/org/apache/openjpa/persistence/

Posted by Craig L Russell <Cr...@Sun.COM>.
Hi Patrick,

I'm trying to understand how the code knows it's running in an  
appserver environment...

Thanks,

Craig

On Mar 1, 2007, at 7:52 AM, Patrick Linskey wrote:

> The difference is that in an appserver environment, this will return a
> non-finalizing EM by default, but in a Java SE environment, it will
> return a finalizing EM by default. See the last bit of my last comment
> in OPENJPA-160.
>
> -Patrick
>
> -- 
> Patrick Linskey
> BEA Systems, Inc.
>
> ______________________________________________________________________ 
> _
> Notice:  This email message, together with any attachments, may  
> contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and   
> affiliated
> entities,  that may be confidential,  proprietary,  copyrighted   
> and/or
> legally privileged, and is intended solely for the use of the  
> individual
> or entity named in this message. If you are not the intended  
> recipient,
> and have received this message in error, please immediately return  
> this
> by email and then delete it.
>
>> -----Original Message-----
>> From: Craig.Russell@Sun.COM [mailto:Craig.Russell@Sun.COM]
>> Sent: Wednesday, February 28, 2007 10:42 PM
>> To: open-jpa-dev@incubator.apache.org
>> Subject: Re: svn commit: r513183 - in
>> /incubator/openjpa/trunk:
>> openjpa-kernel/src/main/java/org/apache/openjpa/conf/
>> openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/
>> openjpa-persistence/src/main/java/org/apache/openjpa/persistence/
>>
>> Hi Patrick,
>>
>> I don't quite understand the code that follows. What is the
>> difference between this code and simply defaulting the value to non-
>> finalizing impl?
>>
>> Craig
>>
>> On Feb 28, 2007, at 10:31 PM, pcl@apache.org wrote:
>>
>>>          PersistenceUnitInfo pui, Map m) {
>>>          PersistenceProductDerivation pd = new
>>> PersistenceProductDerivation();
>>>          try {
>>> +            // if the BrokerImpl hasn't been specified,
>> switch to the
>>> +            // non-finalizing one, since anything claiming
>> to be a
>>> container
>>> +            // should be doing proper resource management.
>>> +            if (!Configurations.containsProperty(BrokerValue.KEY,
>>> +                pui.getProperties())
>>> +                && !Configurations.containsProperty
>>> (BrokerValue.KEY, m)) {
>>> +                m.put(BrokerValue.KEY,
>>> BrokerValue.NON_FINALIZING_ALIAS);
>>> +            }
>>> +
>>>              ConfigurationProvider cp = pd.load(pui, m);
>>>              if (cp == null)
>>>                  return null;
>>
>> Craig Russell
>> Architect, Sun Java Enterprise System http://java.sun.com/products/ 
>> jdo
>> 408 276-5638 mailto:Craig.Russell@sun.com
>> P.S. A good JDO? O, Gasp!
>>
>>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


RE: svn commit: r513183 - in /incubator/openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/conf/ openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ openjpa-persistence/src/main/java/org/apache/openjpa/persistence/

Posted by Patrick Linskey <pl...@bea.com>.
The difference is that in an appserver environment, this will return a
non-finalizing EM by default, but in a Java SE environment, it will
return a finalizing EM by default. See the last bit of my last comment
in OPENJPA-160.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Craig.Russell@Sun.COM [mailto:Craig.Russell@Sun.COM] 
> Sent: Wednesday, February 28, 2007 10:42 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: svn commit: r513183 - in 
> /incubator/openjpa/trunk: 
> openjpa-kernel/src/main/java/org/apache/openjpa/conf/ 
> openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ 
> openjpa-persistence/src/main/java/org/apache/openjpa/persistence/
> 
> Hi Patrick,
> 
> I don't quite understand the code that follows. What is the  
> difference between this code and simply defaulting the value to non- 
> finalizing impl?
> 
> Craig
> 
> On Feb 28, 2007, at 10:31 PM, pcl@apache.org wrote:
> 
> >          PersistenceUnitInfo pui, Map m) {
> >          PersistenceProductDerivation pd = new  
> > PersistenceProductDerivation();
> >          try {
> > +            // if the BrokerImpl hasn't been specified, 
> switch to the
> > +            // non-finalizing one, since anything claiming 
> to be a  
> > container
> > +            // should be doing proper resource management.
> > +            if (!Configurations.containsProperty(BrokerValue.KEY,
> > +                pui.getProperties())
> > +                && !Configurations.containsProperty 
> > (BrokerValue.KEY, m)) {
> > +                m.put(BrokerValue.KEY,  
> > BrokerValue.NON_FINALIZING_ALIAS);
> > +            }
> > +
> >              ConfigurationProvider cp = pd.load(pui, m);
> >              if (cp == null)
> >                  return null;
> 
> Craig Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
> 
>