-->
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.  [ 13 posts ] 
Author Message
 Post subject: problem in blob insert
PostPosted: Sun May 22, 2005 6:10 pm 
Newbie

Joined: Wed May 18, 2005 2:32 pm
Posts: 11
hi all


i want to insert a blob object in database with hiber blob object.

thats successfully done in tomcat, but in OC4J app server i can't do it and
it return this exception :

operation not allowed: streams type cannot be used in batching


i set this property in system properties too

hibernate.jdbc.use_streams_for_binary = true



anyone have idea ???????????

please help me

thanks all


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 24, 2005 2:20 am 
Newbie

Joined: Mon May 02, 2005 12:56 am
Posts: 17
<property name="hibernate.jdbc.batch_size">0</property>

use this setting in the hibernate.cfg.xml.


Top
 Profile  
 
 Post subject: hi alll
PostPosted: Tue May 24, 2005 9:12 am 
Newbie

Joined: Wed May 18, 2005 2:32 pm
Posts: 11
hi all

thanks shrimon.

my problem was oracle application server (OC4J).

i solve the problem with replacing classes12.jar in OC4J library.

thanks agin


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 12:31 am 
Newbie

Joined: Mon May 02, 2005 12:56 am
Posts: 17
Hi ,


Can you tell me how you inserted a blob into the database

How did you map the column in the mapping file.
and what code did you use in the object setter and getter.

I keep getting the following error.

java.sql.SQLException: No more data to read from socket

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:170)


Top
 Profile  
 
 Post subject: about insert blob
PostPosted: Wed May 25, 2005 3:36 am 
Newbie

Joined: Wed May 18, 2005 2:32 pm
Posts: 11
my mapping file is :

<hibernate-mapping>
<class name="MyEntity" table="GENV_REPORT_GENERATOR" >
<property name="obj"
type="serializable"
not-null="true"
column="REG_REPORT_DESIGN"/>
</class>
</hibernate-mapping>


and in my persisteable class i have a serializeable class :

class MyEntity {
private Serializeable obj;
....
}


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 3:40 am 
Newbie

Joined: Mon May 02, 2005 12:56 am
Posts: 17
Thanks a lot.

But i have one more doubt

So your REG_REPORT_DESIGN is a Blob column

How did you write the setter and getter for that column in the MyEntity Class.
Hope i am not disturbing you.


Thanks in advance

Shrimon


Top
 Profile  
 
 Post subject: re : problem in inserting blob
PostPosted: Wed May 25, 2005 5:27 am 
Newbie

Joined: Wed May 18, 2005 2:32 pm
Posts: 11
hi agin

yep that column is a blob column.

my setter and getter method is :

public ReportBLOB getReportDesign() {
return reportDesign;
}

public void setReportDesign(ReportBLOB reportDesign) {
this.reportDesign = reportDesign;
}


i just save an serialized object. that is just simple setter and getter.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 5:36 am 
Newbie

Joined: Mon May 02, 2005 12:56 am
Posts: 17
Thanks shams

I will try again with this info.

public ReportBLOB getReportDesign() {
return reportDesign;
}

i assume that ReportBLOB is nothing but an ordinary java.sql.Blob.

Please correct me if i am wrong.

Thanks.
Shrimon.


Top
 Profile  
 
 Post subject: pr
PostPosted: Wed May 25, 2005 5:47 am 
Newbie

Joined: Wed May 18, 2005 2:32 pm
Posts: 11
ReportBlob just is an Simple Object
but its implemented "java.io.Serializeable"


i wanna save on object to db. (that is not a file ) it's just a java Object.

i hope success


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 6:47 am 
Newbie

Joined: Tue Jun 07, 2005 4:14 am
Posts: 3
Hi shams,


I have the same problem, thats successfully done in Jdev, but in OC4J app server that return an exception :

operation not allowed: streams type cannot be used in batching.


So I had hibernate.jdbc.use_streams_for_binary = true in "hibernate.cfg"

And I try to change classes12.jar, but it does'nt work.

Where are you find your classes12.jar and where are you change it in OC4J.


thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 7:15 am 
Newbie

Joined: Wed May 18, 2005 2:32 pm
Posts: 11
Hi Wolf

if you have oracle10g installed in yor computer you can find classes12.jar
in its jdbc library

i have an oracle client in my pc and i found classes12.jar in this path :

E:\Oracle\product\10.1.0\Client\jdbc\lib

when you found this library you most do following jobs :

go to your application server jdbc library

path is : E:\Oracle\OracleAS10g\jdbc\lib

in this folder you found you most delete or move two file
1 - classes12.jar
2 - classes12dms.jar

then copy your classes12.jar twice in this library and rename second of them to classes12dms.jar
(in otherhand you have one file with diferent name first name is : classes12.jar and second names is classes12dms.jar)

i hope that you understand this tips.

sorry about my poor english


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 10:40 am 
Newbie

Joined: Tue Jun 07, 2005 4:14 am
Posts: 3
No problem for your english, mine is so bad too (i'm french ...).


It work perfectly.

My application work fine, but now, it's OC4J app server that have some problem.


The administration access on app server is down or work badly.

Have you seen any kind of problem after this modification ?


thanks again.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 11:33 am 
Newbie

Joined: Wed May 18, 2005 2:32 pm
Posts: 11
hi wolf

after replacing this files in my application servers i test it on Windwos Server

and United Server - Suse linux . it work successfull and i have no problem until tody. ;)


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