Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Oracle 8.1.7 driver limit causes problems with CMP

5 views
Skip to first unread message

Joe Herbers

unread,
Jan 3, 2002, 5:43:21 PM1/3/02
to
The information below is from Oracle's site and has been noted by a few
people on various message groups. We had upgraded to 8.1.7 but hadn't put
the latest classes12.zip (June 2001) in our classpath. When we do, we get
the following error from the driver/generated code. We believe this is
because we are hitting the limit cited below. I don't know why the Oracle
driver has this limit, but since WL generates this code for the EB, I don't
see an easy way for us to avoid it.

Anyone have any comments on this? Is my interpretation of the stacktrace
correct? If we go back to the old classes12.zip (June 2000) then we don't
have this problem. But in addition to wanting to run the matching zip file
with the version of the DB, we also want to use some of the functionality in
the 8.1.7 zip. Does BEA have a workaround for CMP?

java.rmi.UnexpectedException: Unexpected exception in
sync.server.system.SystemSessionDataBean.setSessionData():
java.sql.SQLException: ORA-01483: invalid length for DATE or NUMBER bind
variable
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)
at
oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1610
)
at
oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1535)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java
:2053)
at
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedState
ment.java:398)
at
weblogic.jdbc20.pool.PreparedStatement.executeUpdate(PreparedStatement.java:
47)
at
sync.server.system.SystemSessionDataPSWebLogic_CMP_RDBMS.update(SystemSessio
nDataPSWebLogic_CMP_RDBMS.java:318)
at
sync.server.system.SystemSessionDataPSWebLogic_CMP_RDBMS.store(SystemSession
DataPSWebLogic_CMP_RDBMS.java:284)
at weblogic.ejb.internal.EntityEJBContext.store(EntityEJBContext.java:192)
at
weblogic.ejb.internal.EntityEJBContext.beforeCompletion(EntityEJBContext.jav
a:227)
at
weblogic.ejb.internal.StatefulEJBObject.postInvokeNoTx(StatefulEJBObject.jav
a:355)
at weblogic.ejb.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:865)


---
Using Streams to Avoid Limits on setBytes() and setString()
There is a limit on the maximum size of the array which can be bound using
the PreparedStatement class setBytes() method, and on the size of the string
which can be bound using the setString() method.

Above the limits, which depend on the version of the server you use, you
should use setBinaryStream() or setCharacterStream() instead.

When connecting to an Oracle8 database, the limit for setBytes() is 2000
bytes (the maximum size of a RAW in Oracle8) and the limit for setString()
is 4000 bytes (the maximum size of a VARCHAR2 in Oracle8).

When connecting to an Oracle7 database, the limit for setBytes() is 255
bytes (the maximum size of a RAW in Oracle7) and the limit for setString()
is 2000 bytes (the maximum size of a VARCHAR2 in Oracle7).

The 8.1.6 Oracle JDBC drivers may not raise an error if you exceed the limit
when using setBytes() or setString(), but you may receive the following
error:

ORA-17070: Data size bigger than max size for this type

Future versions of the Oracle drivers will raise an error if the length
exceeds these limits.

Slava Imeshev

unread,
Jan 3, 2002, 9:58:08 PM1/3/02
to
Hi Joe,

This limit defines limit written to oracle strings, raws, blobs and clobs
when setBytes is used. It has nothing to do with the exception you're
getting.

Could you show us your CMP deployment descriptor(s)?

Regards,

Slava Imeshev


"Joe Herbers" <Joe.H...@divine.com> wrote in message
news:3c34...@newsgroups.bea.com...

Joe Herbers

unread,
Jan 4, 2002, 9:51:13 AM1/4/02
to
The table has only three fields: two IDs (Number(18)) and a Long Raw that we
are storing a Hashtable in. The field seems to be filled fine most of the
time. With the old driver, it always works. As soon as we switch the new
driver in, certain operations fail consistently. I haven't verified that
the size is indeed > 4k in these cases, but our error matches what others
have seen. Here's the CMP DD but I doubt that helps...

<weblogic-rdbms-bean>
<pool-name>oracle</pool-name>
<table-name>scc_sm_sys_sess_data</table-name>
<attribute-map>
<object-link>
<bean-field>mlSystemSessionDataID</bean-field>
<dbms-column>sys_sess_data_id</dbms-column>
</object-link>
<object-link>
<bean-field>mlSystemSessionID</bean-field>
<dbms-column>sys_sess_id</dbms-column>
</object-link>
<object-link>
<bean-field>mBSessionData</bean-field>
<dbms-column>sys_sess_data</dbms-column>
</object-link>

"Slava Imeshev" <ime...@yahoo.com> wrote in message
news:3c3519bf$1...@newsgroups.bea.com...

Slava Imeshev

unread,
Jan 4, 2002, 1:25:04 PM1/4/02
to
Hi Joe,

From your CMP DD it's clear that you use WL 5.1. Which service pack
do you use?

AFAIR this problem was fixed in WL 6.1, though I'm not sure about
5.1. Could you use ejbc with -keepgenerated option and look at
SystemSessionDataPSWebLogic_CMP_RDBMS.java, particularly
how bind variable related to you LONG RAW? Is setBytes used? Or
it's something like setBinaryStream?

Regards,

Slava Imeshev

"Joe Herbers" <Joe.H...@divine.com> wrote in message

news:3c35...@newsgroups.bea.com...

Joe Herbers

unread,
Jan 7, 2002, 2:15:48 PM1/7/02
to
We use WL 5.1, SP10. I've noticed that sp11 is now out, but it doesn't seem
to have any fixes for this problem (it mentions Oracle 8.1.6, but not 8.1.7,
which seems to be the release in which Oracle started enforcing this limit).
We're kind of stuck at the moment, I'm surprised no one else has encountered
this problem with WebLogic (I have seen postings elsewhere about it with
other AppServers)


"Slava Imeshev" <ime...@yahoo.com> wrote in message

news:3c35f370$3...@newsgroups.bea.com...

Joe Herbers

unread,
Jan 14, 2002, 4:07:32 PM1/14/02
to
I added some debug output to verify that this problem is definitely caused
by the WL generated code/Oracle driver. To do this, I used
the -keepgenerated code on ejbc. Then I modified the generated code to
print the length of the byte array before calling setBytes. I compiled the
class and put an updated version in my bean jar.

When I run our test suite, I see hundreds of calls to setBytes with sizes
such as 315, 368, 1988, 2020. And then occasionally there are sizes of
41932 or 19409. These larger sizes are always followed by the ORA-01483
exceptions.

This appears to be certain confirmation that the problem is caused by the
8.1.7 driver's enforcement of the 4k limit on the methods that the
WL-generated code is using to map our Java byte[] to our Long Raw/BLOB field
in Oracle. Any suggestions for workarounds?


"Joe Herbers" <Joe.H...@divine.com> wrote in message

news:3c39...@newsgroups.bea.com...

Joseph Weinstein

unread,
Jan 14, 2002, 4:32:39 PM1/14/02
to Joe Herbers

Joe Herbers wrote:
>
> I added some debug output to verify that this problem is definitely caused
> by the WL generated code/Oracle driver. To do this, I used
> the -keepgenerated code on ejbc. Then I modified the generated code to
> print the length of the byte array before calling setBytes. I compiled the
> class and put an updated version in my bean jar.
>
> When I run our test suite, I see hundreds of calls to setBytes with sizes
> such as 315, 368, 1988, 2020. And then occasionally there are sizes of
> 41932 or 19409. These larger sizes are always followed by the ORA-01483
> exceptions.
>
> This appears to be certain confirmation that the problem is caused by the
> 8.1.7 driver's enforcement of the 4k limit on the methods that the
> WL-generated code is using to map our Java byte[] to our Long Raw/BLOB field
> in Oracle. Any suggestions for workarounds?

Actually, it indicates the driver's being caught by the limitation that
Oracle itself imposes with setBytes(). This is a known issue I believe, and
you should ask support for a patch to ejbc that generates calls to setBinaryStream()
rather than setBytes().
Joe Weinstein

--
B.E.A. is now hiring! (12/14/01) If interested send a resume to j...@bea.com

DIRECTOR OF PRODUCT PLANS AND STRATEGY San Francisco, CA
E-SALES BUSINESS DEVELOPMENT REPRESENTATIVE Dallas, TX
SOFTWARE ENGINEER (DBA) Liberty Corner, NJ
SENIOR WEB DEVELOPER San Jose, CA
SOFTWARE ENGINEER (ALL LEVELS), CARY, NORTH CAROLINA San Jose, CA
SR. PRODUCT MANAGER Bellevue, WA
SR. WEB DESIGNER San Jose, CA
Channel Marketing Manager - EMEA Region London, GBR
DIRECTOR OF MARKETING STRATEGY, APPLICATION SERVERS San Jose, CA
SENIOR SOFTWARE ENGINEER (PLATFORM) San Jose, CA
E-COMMERCE INTEGRATION ARCHITECT San Jose, CA
QUALITY ASSURANCE ENGINEER Redmond, WA
Services Development Manager (Business Development Manager - Services) Paris, FRA; Munich, DEU
SENIOR SOFTWARE ENGINEER (PLATFORM) Redmond, WA
E-Marketing Programs Specialist EMEA London, GBR
BUSINESS DEVELOPMENT DIRECTOR - E COMMERCE INTEGRATION San Jose, CA
MANAGER, E-SALES Plano, TX

Joe Herbers

unread,
Feb 12, 2002, 2:55:33 PM2/12/02
to
We received a patch from BEA that appears to fix this problem. It works
fine in our testing of the generated CMP Entity Beans. We also changed our
own JDBC code to use setBinaryStream instead of setBytes.

CR065200_510sp10.jar

"Joseph Weinstein" <j...@bea.com> wrote in message
news:3C434E76...@bea.com...

> > > > > "Slava Imeshev" <ime...@yahoo.com> wrote in message
> > > > > news:3c3519bf$1...@newsgroups.bea.com...
> > > > > > Hi Joe,
> > > > > >
> > > > > > This limit defines limit written to oracle strings, raws, blobs
and
> > > > clobs
> > > > > > when setBytes is used. It has nothing to do with the exception
> > you're
> > > > > > getting.
> > > > > >
> > > > > >

> > > > > > > ---

0 new messages