You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Sebastian Souza <ss...@adinet.com.uy> on 2007/11/30 02:57:46 UTC

cant modify result list running with enhance

I cant modify any result query list when i run my app with openjpa enhance,
any suggestion?

if i dont run with enhance everything its ok

i run with
-javaagent:C:\lib\apache-openjpa-1.0.0\openjpa-1.0.0.jar=addDefaultConstructor=false
-- 
View this message in context: http://www.nabble.com/cant-modify-result-list-running-with-enhance-tf4901170.html#a14039249
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: cant modify result list running with enhance

Posted by Craig L Russell <Cr...@Sun.COM>.
The result of getResultList should be unmodifiable, but the instances  
contained in the List should be modifiable if you execute the query  
in a transaction.

Craig

On Nov 29, 2007, at 11:55 PM, plinskey@gmail.com wrote:

> Hi,
>
> What do you mean by this?Are you saying that you can't insert or
> delete records in the list, or that you can't modify entries in the
> list? I would expect the former regardless of using the enhancer.
>
> -Patrick
>
> On 11/29/07, Sebastian Souza <ss...@adinet.com.uy> wrote:
>>
>> I cant modify any result query list when i run my app with openjpa  
>> enhance,
>> any suggestion?
>>
>> if i dont run with enhance everything its ok
>>
>> i run with
>> -javaagent:C:\lib\apache-openjpa-1.0.0 
>> \openjpa-1.0.0.jar=addDefaultConstructor=false
>> --
>> View this message in context:
>> http://www.nabble.com/cant-modify-result-list-running-with-enhance- 
>> tf4901170.html#a14039249
>> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>>
>>
>
>
> -- 
> Patrick Linskey
> 202 669 5907

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: cant modify result list running with enhance

Posted by pl...@gmail.com.
Hi,

I guess I don't totally understand the use case. Why do you want to
add a record to the result list? Semantically, the result list is the
list of all instances that match the query; adding an instance to the
query result list seems like it erodes this semantic meaning.

I am not surprised that there might be differences in behavior in
different pathways, but you should not rely on these differences being
stable, as the behavior of mutating a result list is undefined in the
JPA spec.

-Patrick

On 11/30/07, Sebastian Souza <ss...@adinet.com.uy> wrote:
>
> This is the example
>
> Collection  MyCollection = query.getResultList ();
> MyCollection.add (a);
>
> Nothing happens when enhanced is on. the element a is not added to the
> collection
>
> or if i do
> MyCollection = new ArrayList  ();
> if query.getResultList () is null, MyCollection is null.
>
> thanks
>
>
> Patrick Linskey-2 wrote:
> >
> > Hi,
> >
> > What do you mean by this?Are you saying that you can't insert or
> > delete records in the list, or that you can't modify entries in the
> > list? I would expect the former regardless of using the enhancer.
> >
> > -Patrick
> >
> > On 11/29/07, Sebastian Souza <ss...@adinet.com.uy> wrote:
> >>
> >> I cant modify any result query list when i run my app with openjpa
> >> enhance,
> >> any suggestion?
> >>
> >> if i dont run with enhance everything its ok
> >>
> >> i run with
> >>
> -javaagent:C:\lib\apache-openjpa-1.0.0\openjpa-1.0.0.jar=addDefaultConstructor=false
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/cant-modify-result-list-running-with-enhance-tf4901170.html#a14039249
> >> Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Patrick Linskey
> > 202 669 5907
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/cant-modify-result-list-running-with-enhance-tf4901170.html#a14063325
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>
>


-- 
Patrick Linskey
202 669 5907

Re: cant modify result list running with enhance

Posted by Sebastian Souza <ss...@adinet.com.uy>.
This is the example

Collection  MyCollection = query.getResultList ();
MyCollection.add (a);

Nothing happens when enhanced is on. the element a is not added to the
collection

or if i do
MyCollection = new ArrayList  ();
if query.getResultList () is null, MyCollection is null.

thanks


Patrick Linskey-2 wrote:
> 
> Hi,
> 
> What do you mean by this?Are you saying that you can't insert or
> delete records in the list, or that you can't modify entries in the
> list? I would expect the former regardless of using the enhancer.
> 
> -Patrick
> 
> On 11/29/07, Sebastian Souza <ss...@adinet.com.uy> wrote:
>>
>> I cant modify any result query list when i run my app with openjpa
>> enhance,
>> any suggestion?
>>
>> if i dont run with enhance everything its ok
>>
>> i run with
>> -javaagent:C:\lib\apache-openjpa-1.0.0\openjpa-1.0.0.jar=addDefaultConstructor=false
>> --
>> View this message in context:
>> http://www.nabble.com/cant-modify-result-list-running-with-enhance-tf4901170.html#a14039249
>> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Patrick Linskey
> 202 669 5907
> 
> 

-- 
View this message in context: http://www.nabble.com/cant-modify-result-list-running-with-enhance-tf4901170.html#a14063325
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: cant modify result list running with enhance

Posted by pl...@gmail.com.
Hi,

What do you mean by this?Are you saying that you can't insert or
delete records in the list, or that you can't modify entries in the
list? I would expect the former regardless of using the enhancer.

-Patrick

On 11/29/07, Sebastian Souza <ss...@adinet.com.uy> wrote:
>
> I cant modify any result query list when i run my app with openjpa enhance,
> any suggestion?
>
> if i dont run with enhance everything its ok
>
> i run with
> -javaagent:C:\lib\apache-openjpa-1.0.0\openjpa-1.0.0.jar=addDefaultConstructor=false
> --
> View this message in context:
> http://www.nabble.com/cant-modify-result-list-running-with-enhance-tf4901170.html#a14039249
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>
>


-- 
Patrick Linskey
202 669 5907