Subject | Blob sub type with jaybird, charset problem |
---|---|
Author | Ivar Abrahamsen |
Post date | 2005-08-24T17:18:32Z |
Hi,
We are running a firebird 1.5 database using jaybird and hibernate 3.
We have a field designated as text by setting it as blob sub type 1
which in firebird speak is a text clob.
Using hibernate we can write data to this field, but when reading it
it throws up the exception below.
The exception seems to indicate that jaybird does not check if a char
set is not set, and thus throws a wobbler.
When we checked the database it had a default character set as none.
We ran UPDATE rdb$database SET rdb$character_set_name='ISO8859_1'
on the database, but obviously the already existing tables and data
probably are not affected.
Any suggestions? Is there an easy way to restore the db while changing
the charset all its tables and data? More importantly will that solve
the problem?
java.lang.NullPointerException: charsetName
at java.io.OutputStreamWriter.<init>(Outpu
tStreamWriter.java:81)
at
org.firebirdsql.jdbc.FBBlob.copyCharacterStream(FBBlob.java:475)
at
org.firebirdsql.jdbc.field.FBBlobField.copyCharact
erStream(FBBlobField.java:296)
at
org.firebirdsql.jdbc.field.FBBlobField.setCharacte
rStream(FBBlobField.java:205)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.set
CharacterStream(AbstractPreparedStatement.java:694)
at
org.jboss.resource.adapter.jdbc.WrappedPreparedSta
tement.setCharacterStream(WrappedPreparedStatement.java:652)
at org.hibernate.type.TextType.set(TextType.java:22)
at
org.hibernate.type.NullableType.nullSafeSet(NullableType.java:62)
at
org.hibernate.type.NullableType.nullSafeSet(NullableType.java:39)
at
org.hibernate.persister.entity.BasicEntityPersiste
r.dehydrate(BasicEntityPersister.java:1607)
at
org.hibernate.persister.entity.BasicEntityPersiste
r.update(BasicEntityPersister.java:1953)
at
org.hibernate.persister.entity.BasicEntityPersiste
r.updateOrInsert(BasicEntityPersister.java:1899)
at
org.hibernate.persister.entity.BasicEntityPersiste
r.update(BasicEntityPersister.java:2139)
at
org.hibernate.action.EntityUpdateAction.execute(En
tityUpdateAction.java:75)
at org.hibernate.engine.ActionQueue.execut
e(ActionQueue.java:239)
at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:137)
at
org.hibernate.event.def.AbstractFlushingEventListe
ner.performExecutions(AbstractFlushingEventListener.java:274)
at
org.hibernate.event.def.DefaultFlushEventListener.
onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:716)
at
com.videocoding.vicop.da.hibernate.HibernateSessio
n.flush(HibernateSession.java:69)
at
com.videocoding.vicop.da.hibernate.HibernateSessio
n.close(HibernateSession.java:57)
at
com.videocoding.vicop.services.admin.impl.BrandAdm
inServiceImpl.saveBrand(BrandAdminServiceImpl.java:284)
at
com.videocoding.vicop.actions.admin.NewBrandAction
.executeAction(NewBrandAction.java:51)
at
com.videocoding.vicop.actions.admin.AdminVicopActi
on.execute(AdminVicopAction.java:29)
at
org.apache.struts.action.RequestProcessor.processA
ctionPerform(RequestProcessor.java:421)
at
org.apache.struts.action.RequestProcessor.process(
RequestProcessor.java:226)
at
org.apache.struts.action.ActionServlet.process(Act
ionServlet.java:1164)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(
HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(
HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.in
ternalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.do
Filter(ApplicationFilterChain.java:173)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF
ilter(ReplyHeaderFilter.java:81)
at
org.apache.catalina.core.ApplicationFilterChain.in
ternalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.do
Filter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invo
ke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invo
ke(StandardContextValve.java:178)
at
org.jboss.web.tomcat.security.CustomPrincipalValve
.invoke(CustomPrincipalValve.java:39)
at
org.jboss.web.tomcat.security.SecurityAssociationV
alve.invoke(SecurityAssociationValve.java:153)
at
org.jboss.web.tomcat.security.JaccContextValve.inv
oke(JaccContextValve.java:59)
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.invok
e(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.servic
e(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(H
ttp11Processor.java:856)
at
org.apache.coyote.http11.Http11Protocol$Http11Conn
ectionHandler.processConnection(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.process
Socket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.MasterSlaveWorkerThread
.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
We are running a firebird 1.5 database using jaybird and hibernate 3.
We have a field designated as text by setting it as blob sub type 1
which in firebird speak is a text clob.
Using hibernate we can write data to this field, but when reading it
it throws up the exception below.
The exception seems to indicate that jaybird does not check if a char
set is not set, and thus throws a wobbler.
When we checked the database it had a default character set as none.
We ran UPDATE rdb$database SET rdb$character_set_name='ISO8859_1'
on the database, but obviously the already existing tables and data
probably are not affected.
Any suggestions? Is there an easy way to restore the db while changing
the charset all its tables and data? More importantly will that solve
the problem?
java.lang.NullPointerException: charsetName
at java.io.OutputStreamWriter.<init>(Outpu
tStreamWriter.java:81)
at
org.firebirdsql.jdbc.FBBlob.copyCharacterStream(FBBlob.java:475)
at
org.firebirdsql.jdbc.field.FBBlobField.copyCharact
erStream(FBBlobField.java:296)
at
org.firebirdsql.jdbc.field.FBBlobField.setCharacte
rStream(FBBlobField.java:205)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.set
CharacterStream(AbstractPreparedStatement.java:694)
at
org.jboss.resource.adapter.jdbc.WrappedPreparedSta
tement.setCharacterStream(WrappedPreparedStatement.java:652)
at org.hibernate.type.TextType.set(TextType.java:22)
at
org.hibernate.type.NullableType.nullSafeSet(NullableType.java:62)
at
org.hibernate.type.NullableType.nullSafeSet(NullableType.java:39)
at
org.hibernate.persister.entity.BasicEntityPersiste
r.dehydrate(BasicEntityPersister.java:1607)
at
org.hibernate.persister.entity.BasicEntityPersiste
r.update(BasicEntityPersister.java:1953)
at
org.hibernate.persister.entity.BasicEntityPersiste
r.updateOrInsert(BasicEntityPersister.java:1899)
at
org.hibernate.persister.entity.BasicEntityPersiste
r.update(BasicEntityPersister.java:2139)
at
org.hibernate.action.EntityUpdateAction.execute(En
tityUpdateAction.java:75)
at org.hibernate.engine.ActionQueue.execut
e(ActionQueue.java:239)
at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:137)
at
org.hibernate.event.def.AbstractFlushingEventListe
ner.performExecutions(AbstractFlushingEventListener.java:274)
at
org.hibernate.event.def.DefaultFlushEventListener.
onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:716)
at
com.videocoding.vicop.da.hibernate.HibernateSessio
n.flush(HibernateSession.java:69)
at
com.videocoding.vicop.da.hibernate.HibernateSessio
n.close(HibernateSession.java:57)
at
com.videocoding.vicop.services.admin.impl.BrandAdm
inServiceImpl.saveBrand(BrandAdminServiceImpl.java:284)
at
com.videocoding.vicop.actions.admin.NewBrandAction
.executeAction(NewBrandAction.java:51)
at
com.videocoding.vicop.actions.admin.AdminVicopActi
on.execute(AdminVicopAction.java:29)
at
org.apache.struts.action.RequestProcessor.processA
ctionPerform(RequestProcessor.java:421)
at
org.apache.struts.action.RequestProcessor.process(
RequestProcessor.java:226)
at
org.apache.struts.action.ActionServlet.process(Act
ionServlet.java:1164)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(
HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(
HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.in
ternalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.do
Filter(ApplicationFilterChain.java:173)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF
ilter(ReplyHeaderFilter.java:81)
at
org.apache.catalina.core.ApplicationFilterChain.in
ternalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.do
Filter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invo
ke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invo
ke(StandardContextValve.java:178)
at
org.jboss.web.tomcat.security.CustomPrincipalValve
.invoke(CustomPrincipalValve.java:39)
at
org.jboss.web.tomcat.security.SecurityAssociationV
alve.invoke(SecurityAssociationValve.java:153)
at
org.jboss.web.tomcat.security.JaccContextValve.inv
oke(JaccContextValve.java:59)
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.invok
e(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.servic
e(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(H
ttp11Processor.java:856)
at
org.apache.coyote.http11.Http11Protocol$Http11Conn
ectionHandler.processConnection(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.process
Socket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.MasterSlaveWorkerThread
.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)