Bug 109008 - Oracle 'thin' JDBC driver doesn't work
Oracle 'thin' JDBC driver doesn't work
Status: CLOSED NOTABUG
Product: Red Hat Web Application Framework
Classification: Retired
Component: persistence (Show other bugs)
5.2
All Linux
medium Severity high
: ---
: ---
Assigned To: ccm-bugs-list
Jon Orris
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-11-04 05:24 EST by Daniel Berrange
Modified: 2008-08-02 19:40 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-09-02 13:11:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Daniel Berrange 2003-11-04 05:24:14 EST
Description of problem:
Attempting to load APLAWS using the oracle 'thin' JDBC driver, results
in the following error being thrown:

com.arsdigita.persistence.PersistenceException: 
Occurred while:
    Inserting information for
[com.arsdigita.versioning.GenericOperation:{id=453}] (root cause:
java.sql.SQLException: Data size bigger than max size for this type: 1084)
        at
com.arsdigita.persistence.PersistenceException.newInstance(PersistenceException.java:128)
        at
com.arsdigita.persistence.PersistenceException.newInstance(PersistenceException.java:109)
        at
com.arsdigita.persistence.DataStore$2.visit(DataStore.java(Compiled Code))
        at
com.arsdigita.persistence.sql.Identifier.traverse(Identifier.java(Compiled
Code))
        at
com.arsdigita.persistence.sql.SQL.traverse(SQL.java(Compiled Code))
        at com.arsdigita.persistence.sql.SQL.traverse(SQL.java(Inlined
Compiled Code))
        at
com.arsdigita.persistence.sql.Clause.traverse(Clause.java(Compiled Code))
        at
com.arsdigita.persistence.sql.Statement.traverse(Statement.java(Compiled
Code))
        at
com.arsdigita.persistence.DataStore.fireOperation(DataStore.java(Compiled
Code))
        at
com.arsdigita.persistence.DataStore.fireEvent(DataStore.java(Compiled
Code))
        at
com.arsdigita.persistence.DataStore.fireEvent(DataStore.java:100)
        at
com.arsdigita.persistence.DataStore.doInsert(DataStore.java:701)
        at
com.arsdigita.persistence.GenericDataObject.doInsert(GenericDataObject.java:803)
        at
com.arsdigita.persistence.GenericDataObject.save(GenericDataObject.java:335)
        at com.arsdigita.domain.DomainObject.save(DomainObject.java:314)
        at com.arsdigita.versioning.Operation.save(Operation.java:143)
        at
com.arsdigita.versioning.GenericOperation.save(GenericOperation.java:211)
        at com.arsdigita.versioning.Transaction.save(Transaction.java:309)
        at
com.arsdigita.versioning.VersionController.afterSave(VersionController.java:655)
        at
com.arsdigita.domain.ObservableDomainObject.afterSave(ObservableDomainObject.java:197)
        at com.arsdigita.cms.ContentItem.afterSave(ContentItem.java:330)
        at
com.arsdigita.domain.DomainObject$SaveObserver.afterSave(DomainObject.java:618)
        at
com.arsdigita.persistence.AfterSaveEvent.invoke(DataEvent.java:129)
        at
com.arsdigita.persistence.GenericDataObject.fireObserver(GenericDataObject.java(Compiled
Code))
        at
com.arsdigita.persistence.GenericDataObject.fireAfterSave(GenericDataObject.java:194)
        at
com.arsdigita.persistence.GenericDataObject.save(GenericDataObject.java:346)
        at com.arsdigita.domain.DomainObject.save(DomainObject.java:314)
        at
com.arsdigita.cms.installer.SectionInitializer.registerTemplate(SectionInitializer.java:471)
        at
com.arsdigita.cms.installer.SectionInitializer.registerContentTypes(SectionInitializer.java:386)
        at
com.arsdigita.cms.installer.SectionInitializer.createSection(SectionInitializer.java:213)
        at
com.arsdigita.cms.installer.SectionInitializer.doStartup(SectionInitializer.java:169)
        at
com.arsdigita.kernel.BaseInitializer$1.excurse(BaseInitializer.java:50)
        at
com.arsdigita.kernel.KernelExcursion.run(KernelExcursion.java:57)
        at
com.arsdigita.kernel.BaseInitializer.startup(BaseInitializer.java:53)
        at com.arsdigita.initializer.Script.startup(Script.java:181)
        at com.arsdigita.initializer.Script.startup(Script.java:151)
        at
com.arsdigita.dispatcher.InitializerServlet.init(InitializerServlet.java:69)
        at javax.servlet.GenericServlet.init(GenericServlet.java:82)
        at
com.caucho.server.http.Application.createServlet(Application.java:3111)
        at
com.caucho.server.http.Application.loadServlet(Application.java:3062)
        at
com.caucho.server.http.Application.initServlets(Application.java:1923)
        at com.caucho.server.http.Application.init(Application.java:1849)
        at com.caucho.server.http.VirtualHost.init(VirtualHost.java:728)
        at
com.caucho.server.http.ServletServer.initHosts(ServletServer.java:885)
        at
com.caucho.server.http.ServletServer.initInternal(ServletServer.java:727)
        at
com.caucho.server.http.ServletServer.init(ServletServer.java:538)
        at com.caucho.server.http.ResinServer.init(ResinServer.java:391)
        at com.caucho.server.http.ResinServer.main(ResinServer.java:1152)
        at com.caucho.server.http.HttpServer.main(HttpServer.java:103)
Root cause: 
java.sql.SQLException: Data size bigger than max size for this type: 1084
        at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
        at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
        at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java(Compiled
Code))
        at
oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java(Compiled
Code))
        at
oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java(Inlined
Compiled Code))
        at
oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java(Compiled
Code))
        at
com.arsdigita.db.PreparedStatement.setString(PreparedStatement.java(Compiled
Code))
        at
com.arsdigita.persistence.metadata.MetadataRoot$2.bindValue(MetadataRoot.java(Compiled
Code))
        at
com.arsdigita.persistence.metadata.SimpleType.bind(SimpleType.java(Compiled
Code))
        at
com.arsdigita.persistence.DataStore$2.visit(DataStore.java(Compiled Code))
        at
com.arsdigita.persistence.sql.Identifier.traverse(Identifier.java(Compiled
Code))
        at
com.arsdigita.persistence.sql.SQL.traverse(SQL.java(Compiled Code))
        at com.arsdigita.persistence.sql.SQL.traverse(SQL.java(Inlined
Compiled Code))
        at
com.arsdigita.persistence.sql.Clause.traverse(Clause.java(Compiled Code))
        at
com.arsdigita.persistence.sql.Statement.traverse(Statement.java(Compiled
Code))
        at
com.arsdigita.persistence.DataStore.fireOperation(DataStore.java(Compiled
Code))
        at
com.arsdigita.persistence.DataStore.fireEvent(DataStore.java(Compiled
Code))
        at
com.arsdigita.persistence.DataStore.fireEvent(DataStore.java:100)
        at
com.arsdigita.persistence.DataStore.doInsert(DataStore.java:701)
        at
com.arsdigita.persistence.GenericDataObject.doInsert(GenericDataObject.java:803)
        at
com.arsdigita.persistence.GenericDataObject.save(GenericDataObject.java:335)
        at com.arsdigita.domain.DomainObject.save(DomainObject.java:314)
        at com.arsdigita.versioning.Operation.save(Operation.java:143)
        at
com.arsdigita.versioning.GenericOperation.save(GenericOperation.java:211)
        at com.arsdigita.versioning.Transaction.save(Transaction.java:309)
        at
com.arsdigita.versioning.VersionController.afterSave(VersionController.java:655)
        at
com.arsdigita.domain.ObservableDomainObject.afterSave(ObservableDomainObject.java:197)
        at com.arsdigita.cms.ContentItem.afterSave(ContentItem.java:330)
        at
com.arsdigita.domain.DomainObject$SaveObserver.afterSave(DomainObject.java:618)
        at
com.arsdigita.persistence.AfterSaveEvent.invoke(DataEvent.java:129)
        at
com.arsdigita.persistence.GenericDataObject.fireObserver(GenericDataObject.java(Compiled
Code))
        at
com.arsdigita.persistence.GenericDataObject.fireAfterSave(GenericDataObject.java:194)
        at
com.arsdigita.persistence.GenericDataObject.save(GenericDataObject.java:346)
        at com.arsdigita.domain.DomainObject.save(DomainObject.java:314)
        at
com.arsdigita.cms.installer.SectionInitializer.registerTemplate(SectionInitializer.java:471)
        at
com.arsdigita.cms.installer.SectionInitializer.registerContentTypes(SectionInitializer.java:386)
        at
com.arsdigita.cms.installer.SectionInitializer.createSection(SectionInitializer.java:213)
        at
com.arsdigita.cms.installer.SectionInitializer.doStartup(SectionInitializer.java:169)
        at
com.arsdigita.kernel.BaseInitializer$1.excurse(BaseInitializer.java:50)
        at
com.arsdigita.kernel.KernelExcursion.run(KernelExcursion.java:57)
        at
com.arsdigita.kernel.BaseInitializer.startup(BaseInitializer.java:53)
        at com.arsdigita.initializer.Script.startup(Script.java:181)
        at com.arsdigita.initializer.Script.startup(Script.java:151)
        at
com.arsdigita.dispatcher.InitializerServlet.init(InitializerServlet.java:69)
        at javax.servlet.GenericServlet.init(GenericServlet.java:82)
        at
com.caucho.server.http.Application.createServlet(Application.java:3111)
        at
com.caucho.server.http.Application.loadServlet(Application.java:3062)
        at
com.caucho.server.http.Application.initServlets(Application.java:1923)
        at com.caucho.server.http.Application.init(Application.java:1849)
        at com.caucho.server.http.VirtualHost.init(VirtualHost.java:728)
        at
com.caucho.server.http.ServletServer.initHosts(ServletServer.java:885)
        at
com.caucho.server.http.ServletServer.initInternal(ServletServer.java:727)
        at
com.caucho.server.http.ServletServer.init(ServletServer.java:538)
        at com.caucho.server.http.ResinServer.init(ResinServer.java:391)
        at com.caucho.server.http.ResinServer.main(ResinServer.java:1152)
        at com.caucho.server.http.HttpServer.main(HttpServer.java:103)



If I turn up log4j debugging I see it fails on running:

2003-11-04 10:02:49,875 [ main] INFO  persistence.DataStore - Firing
operation
/var/ccm-devel/web/dan/aplaws/webapps/ccm/WEB-INF/pdl/com/arsdigita/versioning/GenericOperation.pdl:19
2003-11-04 10:02:49,876 [ main] DEBUG persistence.DataStore - Binding
:old_value to null
2003-11-04 10:02:49,876 [ main] DEBUG persistence.DataStore - Binding
:new_value to <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
          xmlns:define="/WEB-INF/bebop-define.tld" 
          xmlns:show="/WEB-INF/bebop-show.tld" >

    <jsp:directive.page
import="com.arsdigita.london.navigation.ui.CategoryNav"/>

<define:page name="itemPage" application="content-section" 
  title="APLAWS" cache="true">

<define:component name="categoryNav"
    classname="com.arsdigita.london.navigation.ui.CategoryNav">
  <jsp:scriptlet>
    ((CategoryNav) categoryNav).setUseItemID(true);
  </jsp:scriptlet>
</define:component>
<define:component name="categoryItemNav"
    classname="com.arsdigita.london.navigation.ui.CategoryItemNav">
</define:component>
<define:component name="itemXML"
    classname="com.arsdigita.cms.dispatcher.ContentPanel">
</define:component>
<define:component name="itemSectionXML"
   
classname="com.arsdigita.cms.contenttypes.ui.mparticle.ArticleSectionPanel">
</define:component>
<define:component name="relatedItems"
    classname="com.arsdigita.london.navigation.ui.RelatedItems">
</define:component>
</define:page>

<show:all/>

</jsp:root>



So it seems the JDBC driver can't cope with inserting > 1024 chars
into a VARCHAR.  A quick Google shows this thread:


http://www.mail-archive.com/torque-user@db.apache.org/msg00227.html

I tried editing MetadataRoot so that when binding a String > 1024
chars it used the setCharacterStream method instead of setString and
the error went away.



Version-Release number of selected component (if applicable):


How reproducible:
Every time

Steps to Reproduce:
1. Change JDBC url to jdbc:oracle:thin:host:port:sid
2. Try to start a server from clean database

Additional Information:
Here is a diff of the fix I applied against 5.2

====
//ps/apps/london/core/5.2/src/com/arsdigita/persistence/metadata/MetadataRoot.java#3
-
/var/ccm-devel/dev/dan/aplaws/core/src/com/arsdigita/persistence/metadata/MetadataRoot.java
====
338a339
>                         s_cat.info("Setting string " + stringValue);
339a341
>                             s_cat.info("Set null");
340a343,348
>                         } else if (DbHelper.getDatabase() ==
DbHelper.DB_ORACLE &&
>                                    stringValue.length() > 1024){
>                             s_cat.info("Set stream");
>                             ps.setCharacterStream(index,
>                                                   new
java.io.StringReader(stringValue),
>                                                   stringValue.length());
341a350
>                             s_cat.info("Set null");

It should really check that we are using Oracle *and* the thin driver,
rather than just oracle.
Comment 1 Daniel Berrange 2003-11-04 05:50:49 EST
A look at the source for Rickshaw/Troika, indicates a similar fix is
probably need for com.redhat.persistence.pdl.adapters.StringAdapter.
Comment 2 Vadim Nasardinov 2003-11-04 09:29:21 EST
Looks like William J Schneider, formerly of ArsDigita:
http://www.mail-archive.com/torque-user@db.apache.org/msg00226.html
Comment 3 Richard Li 2004-01-23 17:28:44 EST
I tried to reproduce this bug before applying the patch, and was
unable to do so.

I installed ccm on Oracle using the Oracle 9.0.2.0.0 thin driver. It
started up fine. I didn't have any content types installed, so I
created a 3000 character lifecycle description (declared VARCHAR4000)
and successfully saved it to the database.
Comment 4 Jon Orris 2004-02-05 09:04:30 EST
I cannot reproduce this either.
Comment 5 Richard Li 2004-02-13 16:44:05 EST
no longer rc1 blocker given above; backport for 5.2 perhaps
Comment 6 Daniel Berrange 2006-09-02 13:11:57 EDT
Closing old bug

Note You need to log in before you can comment on or make changes to this bug.