Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Broken(?) UploadFile example on Oracle

    Using a Power nightly (2011-07-27) and unless I have some problem of my own (and I might), the upload file example from the showcase doesn't seem to work on my Oracle 11 instance.

    More specifically, it's trying to insert the _date_created, _filename, and _filesize columns where there are none defined on the datasource

    Code:
    === 2011-07-29 00:21:24,806 [l0-2] INFO  SQLDriver - [builtinApplication.ProfileAttachment_add] Executing SQL update on 'POLARIS': INSERT INTO PROFILE_ATTACHMENT (FILE_CONTENT, FILE_CONTENT_date_created, FILE_CONTENT_filename, FILE_CONTENT_filesize, PROFILE_ID, ATTACHMENT_ID) VALUES (?, TO_DATE('2011-07-29 00:21:24','YYYY-MM-DD HH24:MI:SS'), 'Julio Boudreaux.swf', 85738, 56, profile_attachment_seq.NextVal)
    which of course yields

    Code:
    java.sql.SQLSyntaxErrorException: ORA-00904: "FILE_CONTENT_FILESIZE": invalid identifier
    
    	at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
    	at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
    	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
    	at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
    	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
    	at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:953)
    	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)
    	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
    	at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3468)
    	at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1350)
    	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
    	at com.isomorphic.sql.SQLDriver.doUpdate(SQLDriver.java:471)
    	at com.isomorphic.sql.SQLDriver.update(SQLDriver.java:425)
    	at com.isomorphic.sql.SQLDriver.executeUpdate(SQLDriver.java:545)
    	at com.isomorphic.sql.SQLDataSource.executeNativeUpdate(SQLDataSource.java:388)
    	at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1341)
    	at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:280)
    	at com.isomorphic.sql.SQLDataSource.executeAdd(SQLDataSource.java:232)
    	at com.isomorphic.datasource.DataSource.execute(DataSource.java:1156)
    	at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:721)
    	at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
    	at com.isomorphic.application.AppBase.execute(AppBase.java:491)
    	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1714)
    	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:199)
    	at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:156)
    	at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:121)
    	at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
    	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
    	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at org.mortbay.jetty.Server.handle(Server.java:324)
    	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
    	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
    	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
    Again, I just took the whole thing and used my own datasource / fields:

    Code:
    <DataSource 
      ID="ProfileAttachment"
      dbName="POLARIS"
      tableName="PROFILE_ATTACHMENT"
      serverType="sql" >
      
      <fields>
            <field name="ATTACHMENT_ID" type="sequence" sequenceName="profile_attachment_seq" primaryKey="true" />
            <field name="PROFILE_ID" type="integer" />
            <field name="FILE_CONTENT" type="imageFile" />
      </fields>
      
    </DataSource>
    Last edited by bbruyn; 28 Jul 2011, 23:42.

    #2
    See the docs for FieldType binary - the same metadata fields are expected to be present for all binary field types.

    Comment

    Working...
    X