-->
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.  [ 4 posts ] 
Author Message
 Post subject: problem reading blob
PostPosted: Fri Apr 28, 2006 3:16 am 
Newbie

Joined: Fri Apr 28, 2006 3:07 am
Posts: 2
Hi,

here's the code:
Code:
      Session session = HibernateUtil.openSession();
      session.beginTransaction();
      BlastQuery q = (BlastQuery) session.load(BlastQuery.class, new Long(8));      
      session.getTransaction().commit();
      session.beginTransaction();
      session.update(q);
      try {
         Blob file = q.getInputAlignmentFile();
         System.out.println(file.getBytes(1, (int) file.length()));
      } catch (SQLException e) {
         e.printStackTrace();
      }      
      session.getTransaction().commit();
      session.close();


And the exception:
Code:
org.postgresql.util.PSQLException: ERROR: invalid large-object descriptor: 0
   at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
   at org.postgresql.core.v3.QueryExecutorImpl.receiveFastpathResult(QueryExecutorImpl.java:583)
   at org.postgresql.core.v3.QueryExecutorImpl.fastpathCall(QueryExecutorImpl.java:482)
   at org.postgresql.fastpath.Fastpath.fastpath(Fastpath.java:70)
   at org.postgresql.fastpath.Fastpath.fastpath(Fastpath.java:110)
   at org.postgresql.fastpath.Fastpath.getInteger(Fastpath.java:122)
   at org.postgresql.largeobject.LargeObject.tell(LargeObject.java:255)
   at org.postgresql.largeobject.LargeObject.size(LargeObject.java:270)
   at org.postgresql.jdbc2.AbstractJdbc2BlobClob.length(AbstractJdbc2BlobClob.java:44)
   at org.hibernate.lob.SerializableBlob.length(SerializableBlob.java:31)
   at biojazz.web.NewSequence.main(NewSequence.java:219)


Everything is fine, when I read the blob in the same transaction with object loading. But I can not do this in a real situation.

Any advices?

Thanks in advance.

Hibernate version: 3

Name and version of the database you are using: PostgreSQL 8.1


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 16, 2006 2:43 pm 
Newbie

Joined: Wed Jul 26, 2006 11:06 am
Posts: 11
Same issue here. Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 9:23 am 
Newbie

Joined: Tue Sep 19, 2006 8:01 am
Posts: 1
Anybody got's solution for that problem?

I'm using Hibernate 3.1.3 and PostgreSQL 8.1
and I have no idea how to solve org.postgresql.util.PSQLException: ERROR: invalid large-object descriptor


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 9:36 am 
Newbie

Joined: Wed Jul 26, 2006 11:06 am
Posts: 11
Please see my post on how I resolved the issue.
http://forum.hibernate.org/viewtopic.php?t=963566&highlight=

Both Part 1 and Part 2 have information regarding this issue.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.