Subject Re: [Firebird-Java] Re: Problem when using Firebird + Hibernate + Blob fields
Author Letícia Álvares Barbalho
exactly the same error message:

2005-09-09 12:02:52,169 DEBUG hibernate.util.JDBCExceptionReporter -> could
not insert: [auge.bean.Cor] [insert into CORES (nome, descricao, cor) values
(?, ?, ?)]
org.firebirdsql.jdbc.FBSQLException: You must use FBBlobs with Firebird.
at org.firebirdsql.jdbc.AbstractPreparedStatement.setBlob(
AbstractPreparedStatement.java:728)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setBlob(
NewProxyPreparedStatement.java:494)
at auge.BinaryBlobType.nullSafeSet(BinaryBlobType.java:39)
at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:141)
at org.hibernate.persister.entity.BasicEntityPersister.dehydrate(
BasicEntityPersister.java:1617)
at org.hibernate.persister.entity.BasicEntityPersister.dehydrate(
BasicEntityPersister.java:1594)
at org.hibernate.persister.entity.BasicEntityPersister.insert(
BasicEntityPersister.java:1850)
at org.hibernate.persister.entity.BasicEntityPersister.insert(
BasicEntityPersister.java:2200)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java
:46)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:136)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(
AbstractFlushingEventListener.java:274)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(
DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)
at auge.conexao.CorService.addCor(CorService.java:232)
at auge.action.AddCorAction.execute(AddCorAction.java:73)
at org.apache.struts.action.RequestProcessor.processActionPerform(
RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java
:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(
MonitorFilter.java:362)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:105)
at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:825)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection
(Http11Protocol.java:738)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
PoolTcpEndpoint.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)
2005-09-09 12:02:52,175 WARN hibernate.util.JDBCExceptionReporter -> SQL
Error: 0, SQLState: HY105
2005-09-09 12:02:52,175 ERROR hibernate.util.JDBCExceptionReporter -> You
must use FBBlobs with Firebird.
2005-09-09 12:02:52,224 ERROR event.def.AbstractFlushingEventListener ->
Could not synchronize database state with session



Are there any other issues with blobs that outside the Hibernate context? Or
through other ways they can be manipulated without major problems?

On 9/9/05, Roman Rokytskyy <rrokytskyy@...> wrote:
>
> > I don't wanna bother, but just by asking... the fix didn't come with the
> > snapshot you've just release some minutes ago, does it? Because I tested
> > it and it's all the same.
>
> Bad... It was included into the build...
>
> public void setBlob(int parameterIndex, Blob blob) throws SQLException {
>
> // if the passed BLOB is not instance of our class, copy its content
> // into the our BLOB
> if (!(blob instanceof FBBlob)) {
> FBBlob fbb = new FBBlob(gdsHelper, blobListener);
> fbb.copyStream(blob.getBinaryStream());
> blob = fbb;
> }
>
> getField(parameterIndex).setBlob((FBBlob) blob);
> isParamSet[parameterIndex - 1] = true;
> }
>
> Do you have the same error message?
>
> Roman
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>


--
Letícia Álvares Barbalho
leticia.barbalho@...


[Non-text portions of this message have been removed]