Subject Re: [Firebird-Java] testing RC2: strange GDSException on a query
Author Haris Papadopoulos
> Hello
>
> Between versions RC1a and RC2 the ResultSetMetaData.getPrecision method
that previously return a wrong value was changed. Now the method take the
precision value from the metadata tables in the database.
>
> From your previous mail, I suppose you use dialect 3. It is true?.
>
> Please send us your query and table definition, this will help to
analyze the problem.
>
> I suspect the problem can be calculated columns or the table name for a
column.
>
> Regards
> Blas Rodriguez Somoza.
>
> At 09/01/2003 17:14 +0200, Haris Papadopoulos wrote:
> >Hi again,
> >
> >I 've been testing my web-apps using a cvs-built version of JBird(just
after rc1a).
> >Today, I tried rc2. When it tries to execute a certain SELECT query that
worked before,
> >I get the following stack trace(as you can see I am using a JBuilder API,
> >I don't know if there is a relation):
> >
> >org.firebirdsql.gds.GDSException: invalid request BLR at offset 1786
> >context already in use (BLR error)
> > at
org.firebirdsql.jgds.GDS_Impl.readStatusVector(GDS_Impl.java:1677)
> > at
org.firebirdsql.jgds.GDS_Impl.receiveResponse(GDS_Impl.java:1630)
> > at
org.firebirdsql.jgds.GDS_Impl.isc_dsql_prepare(GDS_Impl.java:1171)
> > at
org.firebirdsql.jca.FBManagedConnection.prepareSQL(FBManagedConnectio
> >n.java:762)
> > at
org.firebirdsql.jdbc.FBConnection.prepareSQL(FBConnection.java:1082)
> > at
org.firebirdsql.jdbc.FBStatement.prepareFixedStatement(FBStatement.ja
> >va:919)
> > at
org.firebirdsql.jdbc.FBPreparedStatement.prepareFixedStatement(FBPrep
> >aredStatement.java:694)
> > at
org.firebirdsql.jdbc.FBPreparedStatement.prepareFixedStatement(FBPrep
> >aredStatement.java:694)
> > at
org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.j
> >ava:73)
> > at
org.firebirdsql.jdbc.FBConnection.prepareStatement(FBConnection.java:
> >223)
> > at org.firebirdsql.jdbc.FBConnection.getStatement(FBConnection.ja
va:1153
> >)
> > at
org.firebirdsql.jdbc.FBConnection.doQuery(FBConnection.java:1178)
> > at
org.firebirdsql.jdbc.FBResultSetMetaData.getExtendedFieldInfo(FBResul
> >tSetMetaData.java:804)
> > at
org.firebirdsql.jdbc.FBResultSetMetaData.getExtFieldInfo(FBResultSetM
> >etaData.java:643)
> > at
org.firebirdsql.jdbc.FBResultSetMetaData.getPrecision(FBResultSetMeta
> >Data.java:313)
> > at com.borland.dx.sql.dataset.RuntimeMetaData.a(Unknown Source)
> > at com.borland.dx.sql.dataset.JdbcProvider.c(Unknown Source)
> > at com.borland.dx.sql.dataset.JdbcProvider.provideData(Unknown
Source)
> > at com.borland.dx.dataset.StorageDataSet.refresh(Unknown Source)
> > at com.borland.dx.sql.dataset.QueryDataSet.refresh(Unknown
Source)
> >Note that the query joins two tables one of which has many fields (and
blobs) if that matters. I realized though that the number of rows is
irrelevant.
> >Note also that other queries work fine.
> >I don't know if all the above can help the list, I hope that someone can
locate the problem.
> >
> >Thanx,
> >Haris.
> >

Thank you for the reply.
I 've performed some tests today using dialect 3. Here is the table's CREATE
statement:

create table product
(
prdId char(25) not null,
prdId2 char(25) ,
name varchar(100) ,
nameUp varchar(100) ,
nameLG varchar(100) ,
nameUpLG varchar(100) ,
descr BLOB SUB_TYPE 1 CHARACTER SET WIN1253,
descrLG BLOB SUB_TYPE 1 CHARACTER SET WIN1253,
supplierId char(25) ,
vatPct numeric(3,2) ,
mUnit char(10) ,
mUnitLG char(10) ,
wholesalePrc numeric(11,2) ,
wholesalePrcEU numeric(13,4) ,
wholesalePrcCUR1 numeric(13,4) ,
wholesalePrcCUR2 numeric(13,4) ,
retailPrc numeric(11,2) ,
retailPrcEU numeric(13,4) ,
retailPrcCUR1 numeric(13,4) ,
retailPrcCUR2 numeric(13,4) ,
slWholesalePrc numeric(11,2) ,
slWholesalePrcEU numeric(13,4) ,
slWholesalePrcCUR1 numeric(13,4) ,
slWholesalePrcCUR2 numeric(13,4) ,
slRetailPrc numeric(11,2) ,
slRetailPrcEU numeric(13,4) ,
slRetailPrcCUR1 numeric(13,4) ,
slRetailPrcCUR2 numeric(13,4) ,
hdWholesalePrc numeric(11,2) ,
hdWholesalePrcEU numeric(13,4) ,
hdWholesalePrcCUR1 numeric(13,4) ,
hdWholesalePrcCUR2 numeric(13,4) ,
hdRetailPrc numeric(11,2) ,
hdRetailPrcEU numeric(13,4) ,
hdRetailPrcCUR1 numeric(13,4) ,
hdRetailPrcCUR2 numeric(13,4) ,
giftPrc numeric(11,2) ,
giftPrcEU numeric(13,4) ,
giftPrcCUR1 numeric(13,4) ,
giftPrcCUR2 numeric(13,4) ,
weight numeric(12,3) ,
cubemeter numeric(12,3) ,
minOrderQua numeric(11,3) ,
maxOrderQua numeric(11,3) ,
stockQua numeric(11,3) ,
safetyStockQua numeric(11,3) ,
package varchar(40) ,
packageLG varchar(40) ,
img varchar(40) ,
img2 varchar(40) ,
img3 varchar(40) ,
img4 varchar(40) ,
barcode char(25) ,
deliveryDays int ,
catId char(25) ,
hdStockFlag char(1) ,
hdStockFlagW char(1) ,
hotdealFlag char(1) ,
hotdealFlagW char(1) ,
salesFlag char(1) ,
salesFlagW char(1) ,
hdBeginDate timestamp ,
hdEndDate timestamp ,
hdBeginDateW timestamp ,
hdEndDateW timestamp ,
shippingKindZone char(10) ,
shippingValue numeric(13,2) ,
shippingValueEU numeric(13,4) ,
shippingValueCUR1 numeric(13,4) ,
shippingValueCUR2 numeric(13,4) ,
shippingVatPct numeric(3,2) ,
inQua numeric(11,3) ,
outQua numeric(11,3) ,
inVal numeric(13,2) ,
inValEU numeric(13,4) ,
inValCUR1 numeric(13,4) ,
inValCUR2 numeric(13,4) ,
outVal numeric(13,2) ,
outValEU numeric(13,4) ,
outValCUR1 numeric(13,4) ,
outValCUR2 numeric(13,4) ,
prdLock char(1) ,
prdManufactId char(25) ,
prdHideFlag char(1) ,
prdHideFlagW char(1) ,
prdNewColl char(1) ,
prdHomePageLink varchar(100) ,
prdCompFlag char(1) ,
prdHasAttributes char(1) ,
prdStopSalesGlobal char(1) ,
prdStartSales char(1) ,
constraint PK_product primary key (prdId)
);

As you can see the table has many columns (90). SELECT * from product works
with DbVisualizer 3.1 using
FirebirdSQL RC2. It does not work using my bean though(which uses JBuilder
API).
Using my bean, I managed to execute the following query:
-----------------------------------------------------------
SELECT prdId, name, retailPrc, retailPrcEU, descr, descrLG,
prdHasAttributes, img, hdBeginDate, hdEndDate, hdStockFlag, salesFlag,
stockQua, catId, deliveryDays,
prdId2, nameUp, nameLG, nameUpLG, supplierId, vatPct, mUnit, mUnitLG,
wholesalePrc, wholesalePrcEU,
wholesalePrcCUR1, wholesalePrcCUR2, retailPrcCUR1, retailPrcCUR2,
slWholesalePrc, slWholesalePrcEU, slWholesalePrcCUR1,
slWholesalePrcCUR2, slRetailPrc, slRetailPrcEU, slRetailPrcCUR1,
slRetailPrcCUR2, hdWholesalePrc, hdWholesalePrcEU, hdWholesalePrcCUR1,
hdWholesalePrcCUR2,
hdRetailPrc, hdRetailPrcEU, hdRetailPrcCUR1, hdRetailPrcCUR2, giftPrc,
giftPrcEU, giftPrcCUR1, giftPrcCUR2, weight, cubemeter, minOrderQua,
maxOrderQua, safetyStockQua, package, packageLG,
img2, img3, img4, barcode, hdStockFlag, hdStockFlagW, hotdealFlag,
hotdealFlagW, salesFlagW, hdBeginDateW, hdEndDateW, shippingKindZone,
shippingValue, shippingValueEU, shippingValueCUR1, shippingValueCUR2,
shippingVatPct,
inQua, outQua, inVal, inValEU, inValCUR1, inValCUR2, outVal, outValEU,
outValCUR1, outValCUR2, prdLock, prdHideFlag FROM product
----------------------------------------------------------

I left out 7 columns. I tried to add any of the other columns and the same
exception was thrown.
I believe the problem has to do with the number of metadata retrieved from
the database and that sth has also to do with JBuilder API (correct me if
I'm wrong this is just black box testing).

Regards,
Haris.