unknown error on insert

3 posts, 1 answers
  1. Antonio
    Antonio avatar
    2 posts
    Member since:
    Oct 2013

    Posted 17 Jan 2014 Link to this post

    Hi all, 
    we are using telerik openAccess ORM on a web project with IIs6 on a windows 2003 server.

    We have  a curious unknown bug.

    If we link to database from develop machine in debug mode with visual studio 2008, all work fine for a insert into a table called LOTTO. But when we build and deploy the same code on a server machine with iis 6 on .NET 2.0 we have the error.

    sql table script:
    CREATE TABLE lotto
        (numero_gara                    NUMBER(5,0) NOT NULL,
        oggetto_lotto                  VARCHAR2(2000 BYTE) NOT NULL,
        data_inizio_contratto          DATE,
        data_fine_contratto            DATE,
        termine_consegna               DATE,
        termine_consegna_gg            NUMBER(5,0),
        luogo_esecuzione               VARCHAR2(50 BYTE),
        cig                            VARCHAR2(10 BYTE),
        cpv_codice                     VARCHAR2(10 BYTE),
        cpv_descrizione                VARCHAR2(1000 BYTE),
        subtotale_importi_base_netto   NUMBER(12,3),
        subtotale_importi_base_ivato   NUMBER(12,3),
        subtotale_oneri_netto          NUMBER(12,3),
        subtotale_oneri_ivato          NUMBER(12,3),
        totale_netto                   NUMBER(12,3),
        totale_ivato                   NUMBER(12,3),
        id_lotto                       NUMBER NOT NULL,
        contratto                      NUMBER ,
        metaprodotto                   NUMBER,
        username                       VARCHAR2(50 BYTE) NOT NULL,
        data_creazione                 DATE DEFAULT SYSDATE NOT NULL,
        data_modifica                  DATE DEFAULT SYSDATE NOT NULL,
        numero_lotto                   NUMBER,
        luogo_esecuzione_file          BLOB,
        luogo_esecuzione_filename      VARCHAR2(100 BYTE))



    error:
    Insert of '990129208-' failed: System.IndexOutOfRangeException: Index was outside the bounds of the array.
       at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.execute(Nullable`1 commandTimeout)
       at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.execute(Nullable`1 commandTimeout)
       at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes, BatchControlInfo batchControl)
    INSERT INTO "LOTTO" ("CIG", "CONTRATTO", "CPV_CODICE", "CPV_DESCRIZIONE", "DATA_CREAZIONE", "DATA_FINE_CONTRATTO", "DATA_INIZIO_CONTRATTO", "DATA_MODIFICA", "LUOGO_ESECUZIONE", "LUOGO_ESECUZIONE_FILE", "LUOGO_ESECUZIONE_FILENAME", "METAPRODOTTO", "NUMERO_GARA", "NUMERO_LOTTO", "OGGETTO_LOTTO", "SUBTOTALE_IMPORTI_BASE_IVATO", "SUBTOTALE_IMPORTI_BASE_NETTO", "SUBTOTALE_ONERI_IVATO", "SUBTOTALE_ONERI_NETTO", "TERMINE_CONSEGNA", "TERMINE_CONSEGNA_GG", "TOTALE_IVATO", "TOTALE_NETTO", "USERNAME") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING "ID_LOTTO" INTO :AutoIncValue
    Params: [no params] System.IndexOutOfRangeException: Index was outside the bounds of the array.
       at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.execute(Nullable`1 commandTimeout)
       at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.execute(Nullable`1 commandTimeout)
       at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes, BatchControlInfo batchControl)-STACKTRACE:   at Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e)
       at OpenAccessRuntime.ExceptionWrapper.Throw()
       at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.handleException(Exception x, Boolean needsRollback)
       at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.internalCommit(Boolean phase)
       at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.commit()
       at OpenAccessRuntime.DataObjects.UnsynchronizedPMProxy.commit()
       at OpenAccessRuntime.EnlistableObjectScope.CommitChanges()
       at Telerik.OpenAccess.OpenAccessContextBase.SaveChanges(ConcurrencyConflictsProcessingMode failureMode)
       at Telerik.OpenAccess.OpenAccessContextBase.SaveChanges()
       at GPAS.BL.Tables.Lotti.addLotto(Int32 numeroGara, String numeroLotto, String oggetto, String dataInizioContratto, String dataFineContratto, String termineConsegna, String termineConsegnaGG, String CIG, String CPV_CODICE, String CPV_DESCRIZIONE, Decimal subtotaleImportiBaseNetto, Decimal subtotaleImportiBaseIvato, Decimal subtotaleOneriNetto, Decimal subtotaleOneriIvato, Decimal totaleNetto, Decimal totaleIvato, String contratto, String metaprodotto, Byte[] luoEseFile, String luoEseFilename, String username) in D:\progetti\GPAS.BL\Tables\Lotti.cs
    From event viewer we do not have other errors!


    what mean this? 990129208-
    can be the develop machnes architecture ( X64)  and web server ( X86) a problem? Why the error occurs only with this table?


    thanks in advance for any help!


  2. Antonio
    Antonio avatar
    2 posts
    Member since:
    Oct 2013

    Posted 20 Jan 2014 Link to this post

    Problem resolved. It seems caused by a try to write a 0 byte array in
    luogo_esecuzione_file          BLOB

    when no attached file was provided.

    it is curious that it work fine from develop machine and not from server! The database is the same!
  3. DevCraft banner
  4. Answer
    Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 21 Jan 2014 Link to this post

    Hi Antonio,

    many thanks for letting us know what triggers the issue. Why there is a difference remains unclear, but I suspect a different ado.net driver version being used.
    I general, I think using empty arrays should not differ in semantics from using a null. At least this makes the mental model more clear, and prepares you for a move to Oracle: there empty strings and null strings are resulting in the same representation in the database: null.

    Regards,
    Thomas
    Telerik
    OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
Back to Top