Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Teneo Blob field using the EntityManager
Teneo Blob field using the EntityManager [message #428902] Wed, 01 April 2009 14:59 Go to next message
Flavio Donze is currently offline Flavio DonzeFriend
Messages: 211
Registered: July 2009
Location: Switzerland
Senior Member
Hello Martin

I noticed a strange behavior using Blob fields and the EntityManger to
persist.
The following Code:

Blob blob = Hibernate.createBlob(new byte[] { 1, 2, 3, 4 });
object.setIcon(blob);

// does not store the Blob value
EntityManager em = getEntityManager();
em.getTransaction().begin();
em.merge(object);
em.getTransaction().commit();
em.close();

// stores the Blob value
Session session = (Session) getEntityManager().getDelegate();
org.hibernate.Transaction t = session.beginTransaction();
session.saveOrUpdate(object);
t.commit();
session.close();


I modeled the Blob field as described in
http://www.elver.org/hibernate/ejb3_examples.html.
The first code part stores the object but ignores the Blob value, the
second part works.
Is this a Teneo or Hibernate Bug?

greets Flavio


Prozessmanagement und Qualitätsmanagement Software QMS/IMS
https://www.scodi.ch
Re: Teneo Blob field using the EntityManager [message #428908 is a reply to message #428902] Wed, 01 April 2009 16:02 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Flavio,
Indeed strange behavior. I can't really comment why this difference exists. The Hibernate EntityManager/JPA
implementation is a fairly thin layer over the standard Hibernate product. Teneo initializes hibernate with the same
generated mapping for both situations. So it seems a hibernate issue...

What the does the log show?

gr. Martin

Flavio Donzé wrote:
> Hello Martin
>
> I noticed a strange behavior using Blob fields and the EntityManger to
> persist.
> The following Code:
>
> Blob blob = Hibernate.createBlob(new byte[] { 1, 2, 3, 4 });
> object.setIcon(blob);
>
> // does not store the Blob value
> EntityManager em = getEntityManager();
> em.getTransaction().begin();
> em.merge(object);
> em.getTransaction().commit();
> em.close();
>
> // stores the Blob value
> Session session = (Session) getEntityManager().getDelegate();
> org.hibernate.Transaction t = session.beginTransaction();
> session.saveOrUpdate(object);
> t.commit();
> session.close();
>
>
> I modeled the Blob field as described in
> http://www.elver.org/hibernate/ejb3_examples.html.
> The first code part stores the object but ignores the Blob value, the
> second part works.
> Is this a Teneo or Hibernate Bug?
>
> greets Flavio
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo Blob field using the EntityManager [message #428928 is a reply to message #428908] Thu, 02 April 2009 07:56 Go to previous messageGo to next message
Flavio Donze is currently offline Flavio DonzeFriend
Messages: 211
Registered: July 2009
Location: Switzerland
Senior Member
Hi Martin

My Log didn't show me any SQL statements, probably wrong configured. My
log4j.properties seems to be ignored. I read the tips (adding it to the
build.properties....), but no success.
Anyway, so I enabled Environment.SHOW_SQL:

Hibernate: insert into "category" ("basiccode_parent_path", "name",
"description", "icon", "path") values (?, ?, ?, ?, ?)
Hibernate: insert into "category_classifier" ("category_classifier_path",
elt) values (?, ?)

But that does not really help a lot :-).

I have to organize the logging of our application
( http://ekkes-corner.blogspot.com/2008/10/logging-in-osgi-ent erprise-applications.html),
I will try to implement this in the next days and report back then.

greets
Flavio

Martin Taal wrote:

> Hi Flavio,
> Indeed strange behavior. I can't really comment why this difference exists.
The Hibernate EntityManager/JPA
> implementation is a fairly thin layer over the standard Hibernate product.
Teneo initializes hibernate with the same
> generated mapping for both situations. So it seems a hibernate issue...

> What the does the log show?

> gr. Martin

> Flavio Donzé wrote:
>> Hello Martin
>>
>> I noticed a strange behavior using Blob fields and the EntityManger to
>> persist.
>> The following Code:
>>
>> Blob blob = Hibernate.createBlob(new byte[] { 1, 2, 3, 4 });
>> object.setIcon(blob);
>>
>> // does not store the Blob value
>> EntityManager em = getEntityManager();
>> em.getTransaction().begin();
>> em.merge(object);
>> em.getTransaction().commit();
>> em.close();
>>
>> // stores the Blob value
>> Session session = (Session) getEntityManager().getDelegate();
>> org.hibernate.Transaction t = session.beginTransaction();
>> session.saveOrUpdate(object);
>> t.commit();
>> session.close();
>>
>>
>> I modeled the Blob field as described in
>> http://www.elver.org/hibernate/ejb3_examples.html.
>> The first code part stores the object but ignores the Blob value, the
>> second part works.
>> Is this a Teneo or Hibernate Bug?
>>
>> greets Flavio
>>


Prozessmanagement und Qualitätsmanagement Software QMS/IMS
https://www.scodi.ch
Re: Teneo Blob field using the EntityManager [message #428931 is a reply to message #428928] Thu, 02 April 2009 08:25 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Flavio,
The icon column is in the insert statement though.

You can check where log4j reads the log4j.properties file from by setting this as a vm argument:
-Dlog4j.debug
I am not sure if it works in a osgi environment though.

I checked and some Teneo jar files contain log4j.properties files :-(. This can confuse log4j, I will remove them in the
next build.

gr. Martin

Flavio Donzé wrote:
> Hi Martin
>
> My Log didn't show me any SQL statements, probably wrong configured. My
> log4j.properties seems to be ignored. I read the tips (adding it to the
> build.properties....), but no success.
> Anyway, so I enabled Environment.SHOW_SQL:
>
> Hibernate: insert into "category" ("basiccode_parent_path", "name",
> "description", "icon", "path") values (?, ?, ?, ?, ?)
> Hibernate: insert into "category_classifier"
> ("category_classifier_path", elt) values (?, ?)
>
> But that does not really help a lot :-).
>
> I have to organize the logging of our application
> ( http://ekkes-corner.blogspot.com/2008/10/logging-in-osgi-ent erprise-applications.html),
> I will try to implement this in the next days and report back then.
>
> greets
> Flavio
>
> Martin Taal wrote:
>
>> Hi Flavio,
>> Indeed strange behavior. I can't really comment why this difference
>> exists.
> The Hibernate EntityManager/JPA
>> implementation is a fairly thin layer over the standard Hibernate
>> product.
> Teneo initializes hibernate with the same
>> generated mapping for both situations. So it seems a hibernate issue...
>
>> What the does the log show?
>
>> gr. Martin
>
>> Flavio Donzé wrote:
>>> Hello Martin
>>>
>>> I noticed a strange behavior using Blob fields and the EntityManger
>>> to persist.
>>> The following Code:
>>>
>>> Blob blob = Hibernate.createBlob(new byte[] { 1, 2, 3, 4 });
>>> object.setIcon(blob);
>>>
>>> // does not store the Blob value
>>> EntityManager em = getEntityManager();
>>> em.getTransaction().begin();
>>> em.merge(object);
>>> em.getTransaction().commit();
>>> em.close();
>>>
>>> // stores the Blob value
>>> Session session = (Session) getEntityManager().getDelegate();
>>> org.hibernate.Transaction t = session.beginTransaction();
>>> session.saveOrUpdate(object);
>>> t.commit();
>>> session.close();
>>>
>>>
>>> I modeled the Blob field as described in
>>> http://www.elver.org/hibernate/ejb3_examples.html.
>>> The first code part stores the object but ignores the Blob value, the
>>> second part works.
>>> Is this a Teneo or Hibernate Bug?
>>>
>>> greets Flavio
>>>
>
>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo Blob field using the EntityManager [message #428944 is a reply to message #428931] Fri, 03 April 2009 07:34 Go to previous messageGo to next message
Flavio Donze is currently offline Flavio DonzeFriend
Messages: 211
Registered: July 2009
Location: Switzerland
Senior Member
ciao Martin

Thanks for the tip. Doesn't seem to work though :-(. Then I tried passing
the attributes as VM arguments:
-Dlog4j.logger.org.hibernate.type=trace
-Dlog4j.logger.org.hibernate.SQL=debug

No result still only get the mapping log messages:
672 [Start Level Event Dispatcher] INFO org.hibernate.cfg.HbmBinder -
Mapping union-subclass: DataObject -> dataobject

I think I will have to really look into the whole logging story.
ekkes-corner.blogspot.com seems to be a good place to start.

cheers
Flavio

Martin Taal wrote:

> Hi Flavio,
> The icon column is in the insert statement though.

> You can check where log4j reads the log4j.properties file from by setting
this as a vm argument:
> -Dlog4j.debug
> I am not sure if it works in a osgi environment though.

> I checked and some Teneo jar files contain log4j.properties files :-(. This
can confuse log4j, I will remove them in the
> next build.

> gr. Martin

> Flavio Donzé wrote:
>> Hi Martin
>>
>> My Log didn't show me any SQL statements, probably wrong configured. My
>> log4j.properties seems to be ignored. I read the tips (adding it to the
>> build.properties....), but no success.
>> Anyway, so I enabled Environment.SHOW_SQL:
>>
>> Hibernate: insert into "category" ("basiccode_parent_path", "name",
>> "description", "icon", "path") values (?, ?, ?, ?, ?)
>> Hibernate: insert into "category_classifier"
>> ("category_classifier_path", elt) values (?, ?)
>>
>> But that does not really help a lot :-).
>>
>> I have to organize the logging of our application
>>
( http://ekkes-corner.blogspot.com/2008/10/logging-in-osgi-ent erprise-applications.html),
>> I will try to implement this in the next days and report back then.
>>
>> greets
>> Flavio
>>
>> Martin Taal wrote:
>>
>>> Hi Flavio,
>>> Indeed strange behavior. I can't really comment why this difference
>>> exists.
>> The Hibernate EntityManager/JPA
>>> implementation is a fairly thin layer over the standard Hibernate
>>> product.
>> Teneo initializes hibernate with the same
>>> generated mapping for both situations. So it seems a hibernate issue...
>>
>>> What the does the log show?
>>
>>> gr. Martin
>>
>>> Flavio Donzé wrote:
>>>> Hello Martin
>>>>
>>>> I noticed a strange behavior using Blob fields and the EntityManger
>>>> to persist.
>>>> The following Code:
>>>>
>>>> Blob blob = Hibernate.createBlob(new byte[] { 1, 2, 3, 4 });
>>>> object.setIcon(blob);
>>>>
>>>> // does not store the Blob value
>>>> EntityManager em = getEntityManager();
>>>> em.getTransaction().begin();
>>>> em.merge(object);
>>>> em.getTransaction().commit();
>>>> em.close();
>>>>
>>>> // stores the Blob value
>>>> Session session = (Session) getEntityManager().getDelegate();
>>>> org.hibernate.Transaction t = session.beginTransaction();
>>>> session.saveOrUpdate(object);
>>>> t.commit();
>>>> session.close();
>>>>
>>>>
>>>> I modeled the Blob field as described in
>>>> http://www.elver.org/hibernate/ejb3_examples.html.
>>>> The first code part stores the object but ignores the Blob value, the
>>>> second part works.
>>>> Is this a Teneo or Hibernate Bug?
>>>>
>>>> greets Flavio
>>>>
>>
>>
>>
>>


Prozessmanagement und Qualitätsmanagement Software QMS/IMS
https://www.scodi.ch
Re: Teneo Blob field using the EntityManager [message #429223 is a reply to message #428931] Wed, 15 April 2009 09:18 Go to previous messageGo to next message
Flavio Donze is currently offline Flavio DonzeFriend
Messages: 211
Registered: July 2009
Location: Switzerland
Senior Member
Hi Martin

I finally got the logging story of our framework under control.

So now the strange thing is, that in both cases I get the same log output:

DEBUG: org.hibernate.SQL - insert into "category"
("basiccode_parent_path", "name", "description", "icon", "path") values
(?, ?, ?, ?, ?)
TRACE: org.hibernate.type.StringType - binding null to parameter: 1
TRACE: org.hibernate.type.StringType - binding 'fffff' to parameter: 2
TRACE: org.hibernate.type.StringType - binding '' to parameter: 3
TRACE: org.hibernate.type.StringType - binding 'fffff' to parameter: 5

The icon parameter is missing. Maybe the logger is intentionally ignoring
Blobs since they can get really big.

But it still doesn't make sense why the EntityManager can't store and
using the Session works.

Maybe I should report a bug?

cheers
Flavio

Martin Taal wrote:

> Hi Flavio,
> The icon column is in the insert statement though.

> You can check where log4j reads the log4j.properties file from by setting
this as a vm argument:
> -Dlog4j.debug
> I am not sure if it works in a osgi environment though.

> I checked and some Teneo jar files contain log4j.properties files :-(. This
can confuse log4j, I will remove them in the
> next build.

> gr. Martin

> Flavio Donzé wrote:
>> Hi Martin
>>
>> My Log didn't show me any SQL statements, probably wrong configured. My
>> log4j.properties seems to be ignored. I read the tips (adding it to the
>> build.properties....), but no success.
>> Anyway, so I enabled Environment.SHOW_SQL:
>>
>> Hibernate: insert into "category" ("basiccode_parent_path", "name",
>> "description", "icon", "path") values (?, ?, ?, ?, ?)
>> Hibernate: insert into "category_classifier"
>> ("category_classifier_path", elt) values (?, ?)
>>
>> But that does not really help a lot :-).
>>
>> I have to organize the logging of our application
>>
( http://ekkes-corner.blogspot.com/2008/10/logging-in-osgi-ent erprise-applications.html),
>> I will try to implement this in the next days and report back then.
>>
>> greets
>> Flavio
>>
>> Martin Taal wrote:
>>
>>> Hi Flavio,
>>> Indeed strange behavior. I can't really comment why this difference
>>> exists.
>> The Hibernate EntityManager/JPA
>>> implementation is a fairly thin layer over the standard Hibernate
>>> product.
>> Teneo initializes hibernate with the same
>>> generated mapping for both situations. So it seems a hibernate issue...
>>
>>> What the does the log show?
>>
>>> gr. Martin
>>
>>> Flavio Donzé wrote:
>>>> Hello Martin
>>>>
>>>> I noticed a strange behavior using Blob fields and the EntityManger
>>>> to persist.
>>>> The following Code:
>>>>
>>>> Blob blob = Hibernate.createBlob(new byte[] { 1, 2, 3, 4 });
>>>> object.setIcon(blob);
>>>>
>>>> // does not store the Blob value
>>>> EntityManager em = getEntityManager();
>>>> em.getTransaction().begin();
>>>> em.merge(object);
>>>> em.getTransaction().commit();
>>>> em.close();
>>>>
>>>> // stores the Blob value
>>>> Session session = (Session) getEntityManager().getDelegate();
>>>> org.hibernate.Transaction t = session.beginTransaction();
>>>> session.saveOrUpdate(object);
>>>> t.commit();
>>>> session.close();
>>>>
>>>>
>>>> I modeled the Blob field as described in
>>>> http://www.elver.org/hibernate/ejb3_examples.html.
>>>> The first code part stores the object but ignores the Blob value, the
>>>> second part works.
>>>> Is this a Teneo or Hibernate Bug?
>>>>
>>>> greets Flavio
>>>>
>>
>>
>>
>>


Prozessmanagement und Qualitätsmanagement Software QMS/IMS
https://www.scodi.ch
Re: Teneo Blob field using the EntityManager [message #429245 is a reply to message #429223] Wed, 15 April 2009 09:58 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Flavio,
I have a testcase which tests a lob, it works for entity manager but it uses persist and not merge. I tried with merge
and it also seemed to work.
Can you reproduce this in a small testproject? If so, then please enter a bugzilla and I can test it.
On which hibernate version are you?

gr. Martin

Flavio Donzé wrote:
> Hi Martin
>
> I finally got the logging story of our framework under control.
>
> So now the strange thing is, that in both cases I get the same log output:
>
> DEBUG: org.hibernate.SQL - insert into "category"
> ("basiccode_parent_path", "name", "description", "icon", "path") values
> (?, ?, ?, ?, ?)
> TRACE: org.hibernate.type.StringType - binding null to parameter: 1
> TRACE: org.hibernate.type.StringType - binding 'fffff' to parameter: 2
> TRACE: org.hibernate.type.StringType - binding '' to parameter: 3
> TRACE: org.hibernate.type.StringType - binding 'fffff' to parameter: 5
>
> The icon parameter is missing. Maybe the logger is intentionally
> ignoring Blobs since they can get really big.
>
> But it still doesn't make sense why the EntityManager can't store and
> using the Session works.
>
> Maybe I should report a bug?
>
> cheers
> Flavio
>
> Martin Taal wrote:
>
>> Hi Flavio,
>> The icon column is in the insert statement though.
>
>> You can check where log4j reads the log4j.properties file from by setting
> this as a vm argument:
>> -Dlog4j.debug
>> I am not sure if it works in a osgi environment though.
>
>> I checked and some Teneo jar files contain log4j.properties files :-(.
>> This
> can confuse log4j, I will remove them in the
>> next build.
>
>> gr. Martin
>
>> Flavio Donzé wrote:
>>> Hi Martin
>>>
>>> My Log didn't show me any SQL statements, probably wrong configured.
>>> My log4j.properties seems to be ignored. I read the tips (adding it
>>> to the build.properties....), but no success.
>>> Anyway, so I enabled Environment.SHOW_SQL:
>>>
>>> Hibernate: insert into "category" ("basiccode_parent_path", "name",
>>> "description", "icon", "path") values (?, ?, ?, ?, ?)
>>> Hibernate: insert into "category_classifier"
>>> ("category_classifier_path", elt) values (?, ?)
>>>
>>> But that does not really help a lot :-).
>>>
>>> I have to organize the logging of our application
> ( http://ekkes-corner.blogspot.com/2008/10/logging-in-osgi-ent erprise-applications.html),
>
>>> I will try to implement this in the next days and report back then.
>>>
>>> greets
>>> Flavio
>>>
>>> Martin Taal wrote:
>>>
>>>> Hi Flavio,
>>>> Indeed strange behavior. I can't really comment why this difference
>>>> exists.
>>> The Hibernate EntityManager/JPA
>>>> implementation is a fairly thin layer over the standard Hibernate
>>>> product.
>>> Teneo initializes hibernate with the same
>>>> generated mapping for both situations. So it seems a hibernate issue...
>>>
>>>> What the does the log show?
>>>
>>>> gr. Martin
>>>
>>>> Flavio Donzé wrote:
>>>>> Hello Martin
>>>>>
>>>>> I noticed a strange behavior using Blob fields and the EntityManger
>>>>> to persist.
>>>>> The following Code:
>>>>>
>>>>> Blob blob = Hibernate.createBlob(new byte[] { 1, 2, 3, 4 });
>>>>> object.setIcon(blob);
>>>>>
>>>>> // does not store the Blob value
>>>>> EntityManager em = getEntityManager();
>>>>> em.getTransaction().begin();
>>>>> em.merge(object);
>>>>> em.getTransaction().commit();
>>>>> em.close();
>>>>>
>>>>> // stores the Blob value
>>>>> Session session = (Session) getEntityManager().getDelegate();
>>>>> org.hibernate.Transaction t = session.beginTransaction();
>>>>> session.saveOrUpdate(object);
>>>>> t.commit();
>>>>> session.close();
>>>>>
>>>>>
>>>>> I modeled the Blob field as described in
>>>>> http://www.elver.org/hibernate/ejb3_examples.html.
>>>>> The first code part stores the object but ignores the Blob value,
>>>>> the second part works.
>>>>> Is this a Teneo or Hibernate Bug?
>>>>>
>>>>> greets Flavio
>>>>>
>>>
>>>
>>>
>>>
>
>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo Blob field using the EntityManager [message #429250 is a reply to message #429245] Wed, 15 April 2009 12:55 Go to previous message
Flavio Donze is currently offline Flavio DonzeFriend
Messages: 211
Registered: July 2009
Location: Switzerland
Senior Member
ciao Martin

Hmm persist() seems to work in my case.

I'm using the latest stable release of Hibernate 3.3.1.GA.
But not as OSGi bundle, I packed
hibernate3.jar,
hibernate-entitymanager.jar,
hibernate-commons-annontations.jar,
hibernate-annotations.jar and
antlr-2.7.6.jar
in one bundle. I had some classloading issues when I used the ones from
the Springsource repository. This way I can use BuddyPolicy.
The rest of the dependencies are OSGi bundles.

Anyway, that shouldn't be the root of the problem.

Ok, if I find time I'll make a testproject (maybe in a week or two).

Thanks
Flavio

Martin Taal wrote:

> Hi Flavio,
> I have a testcase which tests a lob, it works for entity manager but it uses
persist and not merge. I tried with merge
> and it also seemed to work.
> Can you reproduce this in a small testproject? If so, then please enter a
bugzilla and I can test it.
> On which hibernate version are you?

> gr. Martin

> Flavio Donzé wrote:
>> Hi Martin
>>
>> I finally got the logging story of our framework under control.
>>
>> So now the strange thing is, that in both cases I get the same log output:
>>
>> DEBUG: org.hibernate.SQL - insert into "category"
>> ("basiccode_parent_path", "name", "description", "icon", "path") values
>> (?, ?, ?, ?, ?)
>> TRACE: org.hibernate.type.StringType - binding null to parameter: 1
>> TRACE: org.hibernate.type.StringType - binding 'fffff' to parameter: 2
>> TRACE: org.hibernate.type.StringType - binding '' to parameter: 3
>> TRACE: org.hibernate.type.StringType - binding 'fffff' to parameter: 5
>>
>> The icon parameter is missing. Maybe the logger is intentionally
>> ignoring Blobs since they can get really big.
>>
>> But it still doesn't make sense why the EntityManager can't store and
>> using the Session works.
>>
>> Maybe I should report a bug?
>>
>> cheers
>> Flavio
>>
>> Martin Taal wrote:
>>
>>> Hi Flavio,
>>> The icon column is in the insert statement though.
>>
>>> You can check where log4j reads the log4j.properties file from by setting
>> this as a vm argument:
>>> -Dlog4j.debug
>>> I am not sure if it works in a osgi environment though.
>>
>>> I checked and some Teneo jar files contain log4j.properties files :-(.
>>> This
>> can confuse log4j, I will remove them in the
>>> next build.
>>
>>> gr. Martin
>>
>>> Flavio Donzé wrote:
>>>> Hi Martin
>>>>
>>>> My Log didn't show me any SQL statements, probably wrong configured.
>>>> My log4j.properties seems to be ignored. I read the tips (adding it
>>>> to the build.properties....), but no success.
>>>> Anyway, so I enabled Environment.SHOW_SQL:
>>>>
>>>> Hibernate: insert into "category" ("basiccode_parent_path", "name",
>>>> "description", "icon", "path") values (?, ?, ?, ?, ?)
>>>> Hibernate: insert into "category_classifier"
>>>> ("category_classifier_path", elt) values (?, ?)
>>>>
>>>> But that does not really help a lot :-).
>>>>
>>>> I have to organize the logging of our application
>>
( http://ekkes-corner.blogspot.com/2008/10/logging-in-osgi-ent erprise-applications.html),
>>
>>>> I will try to implement this in the next days and report back then.
>>>>
>>>> greets
>>>> Flavio
>>>>
>>>> Martin Taal wrote:
>>>>
>>>>> Hi Flavio,
>>>>> Indeed strange behavior. I can't really comment why this difference
>>>>> exists.
>>>> The Hibernate EntityManager/JPA
>>>>> implementation is a fairly thin layer over the standard Hibernate
>>>>> product.
>>>> Teneo initializes hibernate with the same
>>>>> generated mapping for both situations. So it seems a hibernate issue...
>>>>
>>>>> What the does the log show?
>>>>
>>>>> gr. Martin
>>>>
>>>>> Flavio Donzé wrote:
>>>>>> Hello Martin
>>>>>>
>>>>>> I noticed a strange behavior using Blob fields and the EntityManger
>>>>>> to persist.
>>>>>> The following Code:
>>>>>>
>>>>>> Blob blob = Hibernate.createBlob(new byte[] { 1, 2, 3, 4 });
>>>>>> object.setIcon(blob);
>>>>>>
>>>>>> // does not store the Blob value
>>>>>> EntityManager em = getEntityManager();
>>>>>> em.getTransaction().begin();
>>>>>> em.merge(object);
>>>>>> em.getTransaction().commit();
>>>>>> em.close();
>>>>>>
>>>>>> // stores the Blob value
>>>>>> Session session = (Session) getEntityManager().getDelegate();
>>>>>> org.hibernate.Transaction t = session.beginTransaction();
>>>>>> session.saveOrUpdate(object);
>>>>>> t.commit();
>>>>>> session.close();
>>>>>>
>>>>>>
>>>>>> I modeled the Blob field as described in
>>>>>> http://www.elver.org/hibernate/ejb3_examples.html.
>>>>>> The first code part stores the object but ignores the Blob value,
>>>>>> the second part works.
>>>>>> Is this a Teneo or Hibernate Bug?
>>>>>>
>>>>>> greets Flavio
>>>>>>
>>>>
>>>>
>>>>
>>>>
>>
>>
>>
>>


Prozessmanagement und Qualitätsmanagement Software QMS/IMS
https://www.scodi.ch
Previous Topic:Referecing Eattributes
Next Topic:Which ecore datatypes are serializable and which not
Goto Forum:
  


Current Time: Fri Apr 26 22:01:51 GMT 2024

Powered by FUDForum. Page generated in 0.06866 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top