-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: Hibernate + Firebird
PostPosted: Mon Sep 05, 2005 10:00 am 
Regular
Regular

Joined: Mon Aug 29, 2005 9:46 am
Posts: 102
Basically, what I'd like to know here is: Who has used Hibernate + Firebird? Please, if you have, tell me.

And if you have used it, have you used blob fields? Have you written to them? Has it worked?

I'm asking because there's almost a week I'm trying to simply write a content to a blob field, and it doesn't work. I have even asked here twice:
http://forum.hibernate.org/viewtopic.ph ... ebird+blob
http://forum.hibernate.org/viewtopic.ph ... ebird+blob

I have no answer and no solution, and I must do it a way or another. It seems the problem is not with firebird or its driver or hibernate, but the combination of them all. By now, I already believe there's an issue or something. So, if you have done it before, please tell me and prove me wrong. Pleeease don't let me give up hibernate.


Top
 Profile  
 
 Post subject: blobs
PostPosted: Mon Sep 05, 2005 3:18 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
I am not Firebird expert, but I do not suggest giving up Hibernate because of BLOBs. In general blob-s work quite differently on different RDBMS and even Hibernate tries to address those differences I suggest simply resort to good old JDBC.

Connection cnct = hibernateSession.connection();
And then do whatever Firebird demands, perhaps like this:
http://firebird.sourceforge.net/index.p ... &id=faq#10

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 05, 2005 3:42 pm 
Regular
Regular

Joined: Mon Aug 29, 2005 9:46 am
Posts: 102
I entered jaybird users list, and found out someone reporting a bug about this: the same problem I have. But I tried all new versions and still seems bugged. I emailed them asking about this possible bug and where to get it patched, but still I got no answer. I'll wait till tomorrow before I use the JDBC solucion.

Now, let me just ask you one more thing... when manipulating the tables which have blob fields, I must do all data manipulation using JDBC, or I should use JDBC for this field only? The first option seems terrible, since I have a lot of tables with blobs. The second seems better, but unsafe for transactions. What do you think?

Anyway, thanks very much... let's say I was almost successful in writing a program withou JDBC means :S

Thanks


Top
 Profile  
 
 Post subject: blobs
PostPosted: Mon Sep 05, 2005 3:49 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
I suggest Blobs only. And there is no problem with transactions because it all happens inside of the same transaction, provided that that you have a DAO object that has code like this:

public void saveMyObject( SomeObjectWithBlob o ){
Session s = getCurrentHibernateSession();
s.saveOrUpdate( o );//everything is saved except the BLOB
Connection c = s.connection();
// below we persist the BLOB field(s)
...
}

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 05, 2005 4:33 pm 
Regular
Regular

Joined: Mon Aug 29, 2005 9:46 am
Posts: 102
Thank you very much. I guess that's my way to go, since I just confirmed the bug has not yet been fixed.

Thanks for your kindness and patience.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 06, 2005 7:08 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
A better way is to find the proper solution to do it in plain JDBC, and then wrap that nicely in a FireBirdBlobUserType.
Your app won't have to handle blob manually this way.
You can even post that to the wiki area for the others :-)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 06, 2005 7:42 am 
Regular
Regular

Joined: Mon Aug 29, 2005 9:46 am
Posts: 102
I'll try emmanuel, but actually I don't have a clue about how to do it... I'm not exactly a java programmer, but I'll try.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 06, 2005 8:59 am 
Regular
Regular

Joined: Mon Aug 29, 2005 9:46 am
Posts: 102
I did it here the way they teach in:

http://firebird.sourceforge.net/index.p ... &id=faq#10

my code's a mess! it's terrible!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.