-->
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.  [ 2 posts ] 
Author Message
 Post subject: Not able to insert a blob column in the database
PostPosted: Fri May 20, 2005 1:39 am 
Newbie

Joined: Mon May 02, 2005 12:56 am
Posts: 17
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:
<property name="UPLOADEDFILE" column="UPLOADEDFILE" type="java.sql.Blob" />

Code between sessionFactory.openSession() and session.close():
session=HibernateUtil.currentSession();
tx=session.beginTransaction();
session.save(uploadDO);
tx.commit();

In the class file

public void setUPLOADEDFILE(byte[] blobData) {
UPLOADEDFILE=Hibernate.createBlob(blobData);
//UPLOADEDFILE.setBytes(blobData);
try{ //System.out.println("UPLOADEDFILE:"+UPLOADEDFILE.length());
}catch(Exception e){
e.printStackTrace();
}
}

Full stack trace of any exception that occurs:

Mapping the following SQLException, with ErrorCode 17,410 and SQLState <null>, to a StaleConnectionException: java.sql.SQLException: No more data to read from socket
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:170)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:212)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:958)
at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java(Compiled Code))
at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java(Compiled Code))
at oracle.jdbc.ttc7.Ocommoncall.receive(Ocommoncall.java:108)
at oracle.jdbc.ttc7.TTC7Protocol.commit(TTC7Protocol.java:381)
at oracle.jdbc.driver.OracleConnection.commit(OracleConnection.java:925)
at com.ibm.ejs.cm.pool.ConnectO.commit(ConnectO.java:2177)
at com.ibm.ejs.cm.proxy.ConnectionProxy.commit(ConnectionProxy.java:620)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:95)
at hibernate.util.HibernateDBHelper.uploadAsset(HibernateDBHelper.java:220)
at com.statestreet.gsl.sle.auction.bean.UploadAssetBean.execute(UploadAssetBean.java:108)
at com.statestreet.gsl.sle.auction.controller.AuctionServlet.forward(AuctionServlet.java:183)
at com.statestreet.gsl.sle.auction.controller.AuctionAdminController.redirectTo(AuctionAdminController.java:76)
at com.statestreet.gsl.sle.auction.controller.AuctionAdminController.doPost(AuctionAdminController.java:47)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at com.statestreet.gsl.sle.auction.controller.AuctionServlet.service(AuctionServlet.java:283)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:167)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:297)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:110)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:523)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:282)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:112)
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:91)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:184)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:122)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:323)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:252)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)


Name and version of the database you are using:

Oracle 9i

The generated SQL (show_sql=true):
insert into UPLOADASSET (UPLOADSTATUS, UPLOADEDBY, UPLOADEDDATE, UPLOADEDFILE, AUCTIONID) values (?, ?, ?, ?, ?)

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 11:49 am 
Regular
Regular

Joined: Tue May 24, 2005 10:19 am
Posts: 65
try change the type to blob...


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