View Single Post

   
  #1 (permalink)  
Old 04-20-2008, 11:39 AM
kyancy@gmail.com
 
Posts: n/a
Default Can't INSERT blob into specific blob space using JDBC

hello all,

We have an application that uses JDBC for database access. We have a
customer using Informix 9.x and when we installed our application, all
our INSERTs were failing. We determined that it was because there was
no default blob space(s) configured for the Informix server. This
customer does not/will not configure a default blob space in their
Informix database. They were however willing to create a blob space for
our use, so we modified our CREATE TABLE scripts to specify the newly
created blob space for the different columns to use like the following
example:

CREATE TABLE MY_DB_TYPES
(
PKEY INTEGER NOT NULL,
VARCHAR_TYPE LVARCHAR,
INT_TYPE INTEGER,
BIGINT_TYPE INT8,
DOUBLE_TYPE FLOAT,
BLOB_TYPE BLOB,
PRIMARY KEY (PKEY)
) put BLOB_TYPE in (mysbs)

What we found when we tested it against our Informix DB was that even
if we specified the blob space to use when we created the table, when
we performed an INSERT it was still putting the data in the default
blob space, not in the blob space we created/specified. On the
customers system we get an exception like the one below since they do
not have a default blob space configured. Works just fine if a default
space is configured.

We have tried the JDBC driver from both IBM and DataDirect with the
same result. We can reproduce in house if we remove the default
SBSPACENAME parameter from the onconfig file and bounce the informix
server.

Is there some other issue or bug that anyone is aware of with
JDBC/Informix? Is it possible that even when specifying a specific blob
space when creating a table that Informix needs to use the default blob
space as a temporary space before it is ultimately stored in the
specified space?

Wish I had more detail, but sort of an Informix noob. Any and all
suggestions are much appreciated!

kevin


Top-level SQLException: java.sql.SQLException: Smart-large-object
error. SQLException error code: -9810
Nested Cause: Smart Large Objects: No sbspace number specified.
SQLException error code: -12053
Stack Trace:
java.sql.SQLException: Smart-large-object error.
at com.informix.util.IfxErrMsg.getSQLException(IfxErr Msg.java:373)
at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3208)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java :2353)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.j ava:2269)
at com.informix.jdbc.IfxSqli.executeFastPath(IfxSqli. java:5640)
at com.informix.jdbc.IfxSqli.executeFastPath(IfxSqli. java:5565)
at com.informix.jdbc.IfxSmartBlob.IfxLoCreate(IfxSmar tBlob.java:376)
at com.informix.jdbc.IfxSmBlob.i(IfxSmBlob.java:770)
at com.informix.jdbc.IfxSmBlob.a(IfxSmBlob.java:505)
at com.informix.jdbc.IfxResultSet.b(IfxResultSet.java :282)
at com.informix.jdbc.IfxStatement.c(IfxStatement.java :1253)
at
com.informix.jdbc.IfxPreparedStatement.executeUpda te(IfxPreparedStatement.java:408)
at com.workingdogs.village.Record.saveWithInsert(Reco rd.java:1644)
at com.workingdogs.village.Record.save(Record.java:10 93)
at com.workingdogs.village.Record.save(Record.java:10 63)
at
org.apache.torque.util.BasePeer.insertOrUpdateReco rd(BasePeer.java:863)
at org.apache.torque.util.BasePeer.doInsert(BasePeer. java:706)
at com.mycompany.ix.db.peer.BaseIxResourcePeer.doInse rt(Unknown
Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
com.geobot.common.util.loader.ApplLauncher.main(Ap plLauncher.java:200)
Caused by: java.sql.SQLException: Smart Large Objects: No sbspace
number specified.
at com.informix.util.IfxErrMsg.getSQLException(IfxErr Msg.java:373)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3523)
... 28 more

Reply With Quote