db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Obs <obb...@gmail.com>
Subject Re: Reading
Date Thu, 20 Jul 2006 14:30:53 GMT
Heres how Im reading it in
        DatabaseIO dbio = new DatabaseIO();
        dbio.setValidateXml(false);
        Database destmodel = dbio.read(schema);  //This schema is read in
from a file I just wrote.

        Platform destplatform = PlatformFactory.createNewPlatformInstance
(ds);
        destplatform.setDelimitedIdentifierModeOn(true);
        destplatform.alterTables(destmodel, true, true, true); //Syncs the
tables

        try
        {
            DataReader         reader   = new DataReader();
            DataToDatabaseSink sink     = new
DataToDatabaseSink(destplatform, destmodel);
            System.out.println(destmodel);
            sink.setEnsureForeignKeyOrder(true);
            sink.setUseBatchMode(true);
            sink.setBatchSize(1024);
            reader.setModel(destmodel);
            reader.setSink(sink);
            reader.parse(get_importFile()); // This is the data file just
exported from another database
        }
        catch (Exception e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

Here's the stack trace against the schema I sent you

Jul 20, 2006 9:05:05 AM
org.apache.ddlutils.platform.PlatformImplBaseevaluateBatch
INFO: Executed 0 SQL command(s) with 0 error(s)
Database [name=default; 16 tables]
Jul 20, 2006 9:05:06 AM org.apache.commons.digester.Digester endElement
SEVERE: End event threw exception
org.apache.ddlutils.io.DataSinkException:
org.apache.ddlutils.DynaSqlException: Error while inserting into the
database
    at org.apache.ddlutils.io.DataToDatabaseSink.purgeBatchQueue(
DataToDatabaseSink.java:356)
    at org.apache.ddlutils.io.DataToDatabaseSink.insertBeanIntoDatabase(
DataToDatabaseSink.java:325)
    at org.apache.ddlutils.io.DataToDatabaseSink.addBean(
DataToDatabaseSink.java:273)
    at org.apache.ddlutils.io.DynaSqlCreateRule.end(DynaSqlCreateRule.java
:79)
    at org.apache.commons.digester.Digester.endElement(Digester.java:1130)
    at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown
Source)
    at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
    at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
    at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
    at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
Source)
    at org.apache.commons.digester.Digester.parse(Digester.java:1631)
    at com.creative.db.DataCopy.importData(DataCopy.java:87)
    at com.creative.db.DatabaseTest.readFromDatabase(DatabaseTest.java:52)
    at com.creative.db.DatabaseCopy.main(DatabaseCopy.java:15)
Caused by: org.apache.ddlutils.DynaSqlException: Error while inserting into
the database
    at org.apache.ddlutils.platform.PlatformImplBase.executeBatch(
PlatformImplBase.java:1416)
    at org.apache.ddlutils.platform.PlatformImplBase.insert(
PlatformImplBase.java:1332)
    at org.apache.ddlutils.io.DataToDatabaseSink.purgeBatchQueue(
DataToDatabaseSink.java:341)
    ... 17 more
Caused by: java.sql.BatchUpdateException: Cannot insert explicit value for
identity column in table 'tb_AddressAlternate' when IDENTITY_INSERT is set
to OFF.
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeBatch(
JtdsStatement.java:901)
    at org.apache.ddlutils.platform.PlatformImplBase.executeBatch(
PlatformImplBase.java:1399)
    ... 19 more
org.apache.ddlutils.io.DataSinkException:
org.apache.ddlutils.DynaSqlException: Error while inserting into the
database
    at org.apache.commons.digester.Digester.createSAXException(Digester.java
:2919)
    at org.apache.commons.digester.Digester.createSAXException(Digester.java
:2945)
    at org.apache.commons.digester.Digester.endElement(Digester.java:1133)
    at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown
Source)
    at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
    at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
    at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
    at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
Source)
    at org.apache.commons.digester.Digester.parse(Digester.java:1631)
    at com.creative.db.DataCopy.importData(DataCopy.java:87)
    at com.creative.db.DatabaseTest.readFromDatabase(DatabaseTest.java:52)
    at com.creative.db.DatabaseCopy.main(DatabaseCopy.java:15)


On 7/19/06, Thomas Dudziak <tomdzk@gmail.com> wrote:
>
> On 7/19/06, Obs <obbers@gmail.com> wrote:
>
> > Now, I'm just dealing with the identity inserts issue.
>
> What identity insert issue do you mean ?
>
> Tom
>



-- 
Obs

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message