You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Vásáry, Dániel <va...@elgekko.net> on 2010/04/21 19:03:28 UTC

Entity data missing in enhanced mode

Hi,
I'm using OpenJPA 1.2.2 under JavaEE JPA project in Eclipse Galileo.
After adding Bytecode enhancement, named query returns only partial data.
Persisted object looks fine, has all fields filled with proper data.

But if i search for that object with named query or with
EntityManagers.find,
returned entity has 0 value in ID field, and the other fields are empty too,
except String fields.
I need all field's data from entity, for some post processing purposes.

Can anybody help, how to retrive whole data?
thanks

Re: Entity data missing in enhanced mode

Posted by Vásáry, Dániel <va...@elgekko.net>.
Wich OpenJPA version you used? I tried 1.2.2 and 1.2.3.
I am newbie on JAVA and OpenJPA too.
Can some system misconfiguration cause something like that?

2010/4/21 Rick Curtis <cu...@gmail.com>

> Hmm, I'm still not sure what the problem is that you are reporting. I ran
> your same test on HSQLDB and it worked fine for me. Sounds like I still may
> be missing something?
>
> --
> Thanks,
> Rick
>
> On Wed, Apr 21, 2010 at 1:46 PM, Vásáry, Dániel <va...@elgekko.net>
> wrote:
>
> >
> > Yes, the data is properly persisted.
> > I have SQL trace turned on, no errors.
> > I have only one strange debug message: "No cache marshaller found for id
> > org.apache.openjpa.conf.MetaDataCacheMaintenance."
> > Log is attached.
> >
> >
> >
> >
> >
> >
> > propertiesMap.put("openjpa.Log", "SQL=trace");
> >>
> >> Are there any warnings or other errors logged?
> >>
> >> --
> >> Thanks,
> >> Rick
> >>
> >> On Wed, Apr 21, 2010 at 1:19 PM, Vásáry, Dániel <va...@elgekko.net>
> >> wrote:
> >>
> >> > Thanks for quick reply.
> >> > I attached one of the Entities, and unit test.
> >> >
> >> > 2010/4/21 Rick Curtis <cu...@gmail.com>
> >> >
> >> > Can you post some more information? A small unit test would be nice...
> >> but
> >> >> a
> >> >> nice place to start would be by posting the given Entity.
> >> >>
> >> >> --
> >> >> Thanks,
> >> >> Rick
> >> >>
> >> >>
> >> >> On Wed, Apr 21, 2010 at 12:03 PM, Vásáry, Dániel <vasary@elgekko.net
> >
> >> >> wrote:
> >> >>
> >> >> > Hi,
> >> >> > I'm using OpenJPA 1.2.2 under JavaEE JPA project in Eclipse
> Galileo.
> >> >> > After adding Bytecode enhancement, named query returns only partial
> >> >> data.
> >> >> > Persisted object looks fine, has all fields filled with proper
> data.
> >> >> >
> >> >> > But if i search for that object with named query or with
> >> >> > EntityManagers.find,
> >> >> > returned entity has 0 value in ID field, and the other fields are
> >> empty
> >> >> > too,
> >> >> > except String fields.
> >> >> > I need all field's data from entity, for some post processing
> >> purposes.
> >> >> >
> >> >> > Can anybody help, how to retrive whole data?
> >> >> > thanks
> >> >> >
> >> >>
> >> >
> >> >
> >>
> >
> >
>

Re: Entity data missing in enhanced mode

Posted by Rick Curtis <cu...@gmail.com>.
Hmm, I'm still not sure what the problem is that you are reporting. I ran
your same test on HSQLDB and it worked fine for me. Sounds like I still may
be missing something?

-- 
Thanks,
Rick

On Wed, Apr 21, 2010 at 1:46 PM, Vásáry, Dániel <va...@elgekko.net> wrote:

>
> Yes, the data is properly persisted.
> I have SQL trace turned on, no errors.
> I have only one strange debug message: "No cache marshaller found for id
> org.apache.openjpa.conf.MetaDataCacheMaintenance."
> Log is attached.
>
>
>
>
>
>
> propertiesMap.put("openjpa.Log", "SQL=trace");
>>
>> Are there any warnings or other errors logged?
>>
>> --
>> Thanks,
>> Rick
>>
>> On Wed, Apr 21, 2010 at 1:19 PM, Vásáry, Dániel <va...@elgekko.net>
>> wrote:
>>
>> > Thanks for quick reply.
>> > I attached one of the Entities, and unit test.
>> >
>> > 2010/4/21 Rick Curtis <cu...@gmail.com>
>> >
>> > Can you post some more information? A small unit test would be nice...
>> but
>> >> a
>> >> nice place to start would be by posting the given Entity.
>> >>
>> >> --
>> >> Thanks,
>> >> Rick
>> >>
>> >>
>> >> On Wed, Apr 21, 2010 at 12:03 PM, Vásáry, Dániel <va...@elgekko.net>
>> >> wrote:
>> >>
>> >> > Hi,
>> >> > I'm using OpenJPA 1.2.2 under JavaEE JPA project in Eclipse Galileo.
>> >> > After adding Bytecode enhancement, named query returns only partial
>> >> data.
>> >> > Persisted object looks fine, has all fields filled with proper data.
>> >> >
>> >> > But if i search for that object with named query or with
>> >> > EntityManagers.find,
>> >> > returned entity has 0 value in ID field, and the other fields are
>> empty
>> >> > too,
>> >> > except String fields.
>> >> > I need all field's data from entity, for some post processing
>> purposes.
>> >> >
>> >> > Can anybody help, how to retrive whole data?
>> >> > thanks
>> >> >
>> >>
>> >
>> >
>>
>
>

Re: Entity data missing in enhanced mode

Posted by Vásáry, Dániel <va...@elgekko.net>.
Yes, the data is properly persisted.
I have SQL trace turned on, no errors.
I have only one strange debug message: "No cache marshaller found for id
org.apache.openjpa.conf.MetaDataCacheMaintenance."
Log is attached.






propertiesMap.put("openjpa.Log", "SQL=trace");
>
> Are there any warnings or other errors logged?
>
> --
> Thanks,
> Rick
>
> On Wed, Apr 21, 2010 at 1:19 PM, V�s�ry, D�niel <va...@elgekko.net>
> wrote:
>
> > Thanks for quick reply.
> > I attached one of the Entities, and unit test.
> >
> > 2010/4/21 Rick Curtis <cu...@gmail.com>
> >
> > Can you post some more information? A small unit test would be nice...
> but
> >> a
> >> nice place to start would be by posting the given Entity.
> >>
> >> --
> >> Thanks,
> >> Rick
> >>
> >>
> >> On Wed, Apr 21, 2010 at 12:03 PM, V�s�ry, D�niel <va...@elgekko.net>
> >> wrote:
> >>
> >> > Hi,
> >> > I'm using OpenJPA 1.2.2 under JavaEE JPA project in Eclipse Galileo.
> >> > After adding Bytecode enhancement, named query returns only partial
> >> data.
> >> > Persisted object looks fine, has all fields filled with proper data.
> >> >
> >> > But if i search for that object with named query or with
> >> > EntityManagers.find,
> >> > returned entity has 0 value in ID field, and the other fields are
> empty
> >> > too,
> >> > except String fields.
> >> > I need all field's data from entity, for some post processing
> purposes.
> >> >
> >> > Can anybody help, how to retrive whole data?
> >> > thanks
> >> >
> >>
> >
> >
>

Re: Entity data missing in enhanced mode

Posted by Rick Curtis <cu...@gmail.com>.
Your test worked fine for me on MySQL.

Did you check the database to see if the data is properly persisted? You
could try enabling SQL trace to see if that gives us any other clues:
propertiesMap.put("openjpa.Log", "SQL=trace");

Are there any warnings or other errors logged?

-- 
Thanks,
Rick

On Wed, Apr 21, 2010 at 1:19 PM, Vásáry, Dániel <va...@elgekko.net> wrote:

> Thanks for quick reply.
> I attached one of the Entities, and unit test.
>
> 2010/4/21 Rick Curtis <cu...@gmail.com>
>
> Can you post some more information? A small unit test would be nice... but
>> a
>> nice place to start would be by posting the given Entity.
>>
>> --
>> Thanks,
>> Rick
>>
>>
>> On Wed, Apr 21, 2010 at 12:03 PM, Vásáry, Dániel <va...@elgekko.net>
>> wrote:
>>
>> > Hi,
>> > I'm using OpenJPA 1.2.2 under JavaEE JPA project in Eclipse Galileo.
>> > After adding Bytecode enhancement, named query returns only partial
>> data.
>> > Persisted object looks fine, has all fields filled with proper data.
>> >
>> > But if i search for that object with named query or with
>> > EntityManagers.find,
>> > returned entity has 0 value in ID field, and the other fields are empty
>> > too,
>> > except String fields.
>> > I need all field's data from entity, for some post processing purposes.
>> >
>> > Can anybody help, how to retrive whole data?
>> > thanks
>> >
>>
>
>

Re: Entity data missing in enhanced mode

Posted by Vásáry, Dániel <va...@elgekko.net>.
Thanks for quick reply.
I attached one of the Entities, and unit test.

2010/4/21 Rick Curtis <cu...@gmail.com>

> Can you post some more information? A small unit test would be nice... but
> a
> nice place to start would be by posting the given Entity.
>
> --
> Thanks,
> Rick
>
>
> On Wed, Apr 21, 2010 at 12:03 PM, Vásáry, Dániel <va...@elgekko.net>
> wrote:
>
> > Hi,
> > I'm using OpenJPA 1.2.2 under JavaEE JPA project in Eclipse Galileo.
> > After adding Bytecode enhancement, named query returns only partial data.
> > Persisted object looks fine, has all fields filled with proper data.
> >
> > But if i search for that object with named query or with
> > EntityManagers.find,
> > returned entity has 0 value in ID field, and the other fields are empty
> > too,
> > except String fields.
> > I need all field's data from entity, for some post processing purposes.
> >
> > Can anybody help, how to retrive whole data?
> > thanks
> >
>

Re: Entity data missing in enhanced mode

Posted by Rick Curtis <cu...@gmail.com>.
Can you post some more information? A small unit test would be nice... but a
nice place to start would be by posting the given Entity.

-- 
Thanks,
Rick


On Wed, Apr 21, 2010 at 12:03 PM, Vásáry, Dániel <va...@elgekko.net> wrote:

> Hi,
> I'm using OpenJPA 1.2.2 under JavaEE JPA project in Eclipse Galileo.
> After adding Bytecode enhancement, named query returns only partial data.
> Persisted object looks fine, has all fields filled with proper data.
>
> But if i search for that object with named query or with
> EntityManagers.find,
> returned entity has 0 value in ID field, and the other fields are empty
> too,
> except String fields.
> I need all field's data from entity, for some post processing purposes.
>
> Can anybody help, how to retrive whole data?
> thanks
>

Re: Entity data missing in enhanced mode

Posted by Vásáry, Dániel <va...@elgekko.net>.
Not works. I tried it already.

2010/4/21 C N Davies <cn...@cndavies.com>

> Not sure if this is your issue but when I used lazy loading I had similar
> issues. I removed the lazy loading and the issue went away.
>
> Chris
>
>
> -----Original Message-----
> From: Vásáry, Dániel [mailto:vasary@elgekko.net]
> Sent: Thursday, 22 April 2010 3:03 AM
> To: users@openjpa.apache.org
> Subject: Entity data missing in enhanced mode
>
> Hi,
> I'm using OpenJPA 1.2.2 under JavaEE JPA project in Eclipse Galileo.
> After adding Bytecode enhancement, named query returns only partial data.
> Persisted object looks fine, has all fields filled with proper data.
>
> But if i search for that object with named query or with
> EntityManagers.find,
> returned entity has 0 value in ID field, and the other fields are empty
> too,
> except String fields.
> I need all field's data from entity, for some post processing purposes.
>
> Can anybody help, how to retrive whole data?
> thanks
>
>

RE: Entity data missing in enhanced mode

Posted by C N Davies <cn...@cndavies.com>.
Not sure if this is your issue but when I used lazy loading I had similar
issues. I removed the lazy loading and the issue went away.  

Chris


-----Original Message-----
From: Vásáry, Dániel [mailto:vasary@elgekko.net] 
Sent: Thursday, 22 April 2010 3:03 AM
To: users@openjpa.apache.org
Subject: Entity data missing in enhanced mode

Hi,
I'm using OpenJPA 1.2.2 under JavaEE JPA project in Eclipse Galileo.
After adding Bytecode enhancement, named query returns only partial data.
Persisted object looks fine, has all fields filled with proper data.

But if i search for that object with named query or with
EntityManagers.find,
returned entity has 0 value in ID field, and the other fields are empty too,
except String fields.
I need all field's data from entity, for some post processing purposes.

Can anybody help, how to retrive whole data?
thanks


Re: Entity data missing in enhanced mode

Posted by Vásáry, Dániel <va...@elgekko.net>.
Finally, the problem sold with swapping from Eclipse Byte code Enhancer to
ANT based.

Thank you!

2010/4/23 Vásáry, Dániel <va...@elgekko.net>

> With eclipse plugin.
>
> 2010/4/22 Donald Woods <dw...@apache.org>
>
> How are you enhancing the code in Eclipse?  ANT script,
>> openjpa-maven-plugin or our Eclipse plugin?
>>
>> -Donald
>>
>>
>> On 4/21/10 1:03 PM, Vásáry, Dániel wrote:
>> > Hi,
>> > I'm using OpenJPA 1.2.2 under JavaEE JPA project in Eclipse Galileo.
>> > After adding Bytecode enhancement, named query returns only partial
>> data.
>> > Persisted object looks fine, has all fields filled with proper data.
>> >
>> > But if i search for that object with named query or with
>> > EntityManagers.find,
>> > returned entity has 0 value in ID field, and the other fields are empty
>> too,
>> > except String fields.
>> > I need all field's data from entity, for some post processing purposes.
>> >
>> > Can anybody help, how to retrive whole data?
>> > thanks
>> >
>>
>
>

Re: Entity data missing in enhanced mode

Posted by Vásáry, Dániel <va...@elgekko.net>.
With eclipse plugin.

2010/4/22 Donald Woods <dw...@apache.org>

> How are you enhancing the code in Eclipse?  ANT script,
> openjpa-maven-plugin or our Eclipse plugin?
>
> -Donald
>
>
> On 4/21/10 1:03 PM, Vásáry, Dániel wrote:
> > Hi,
> > I'm using OpenJPA 1.2.2 under JavaEE JPA project in Eclipse Galileo.
> > After adding Bytecode enhancement, named query returns only partial data.
> > Persisted object looks fine, has all fields filled with proper data.
> >
> > But if i search for that object with named query or with
> > EntityManagers.find,
> > returned entity has 0 value in ID field, and the other fields are empty
> too,
> > except String fields.
> > I need all field's data from entity, for some post processing purposes.
> >
> > Can anybody help, how to retrive whole data?
> > thanks
> >
>

Re: Entity data missing in enhanced mode

Posted by Donald Woods <dw...@apache.org>.
How are you enhancing the code in Eclipse?  ANT script,
openjpa-maven-plugin or our Eclipse plugin?

-Donald


On 4/21/10 1:03 PM, Vásáry, Dániel wrote:
> Hi,
> I'm using OpenJPA 1.2.2 under JavaEE JPA project in Eclipse Galileo.
> After adding Bytecode enhancement, named query returns only partial data.
> Persisted object looks fine, has all fields filled with proper data.
> 
> But if i search for that object with named query or with
> EntityManagers.find,
> returned entity has 0 value in ID field, and the other fields are empty too,
> except String fields.
> I need all field's data from entity, for some post processing purposes.
> 
> Can anybody help, how to retrive whole data?
> thanks
>