Loading ...
Sorry, an error occurred while loading the content.

Re: Question on keyGenerator

Expand Messages
  • ´H¨M
    Hi I have follow the instructions as below I have changed the KeygeneratorImp.java within xmldbms.jar and compile a new jar for running transfer .java the
    Message 1 of 5 , Mar 8, 2004
    View Source
    • 0 Attachment
      Hi

      I have follow the instructions as below
      I have changed the KeygeneratorImp.java within xmldbms.jar
      and compile a new jar for running transfer .java
      the result is the same

      C:\xmldbms\samples>java Transfer -todbms sales.map sales_in.xml
      java.sql.SQLException: Can't call commit when autocommit=true
      at com.mysql.jdbc.Connection.commit(Connection.java:1175)
      at de.tudarmstadt.ito.xmldbms.Map.commit(Map.java:399)
      at de.tudarmstadt.ito.xmldbms.DOMToDBMS.insertRow
      (DOMToDBMS.java:707)
      at de.tudarmstadt.ito.xmldbms.DOMToDBMS.createClassRow
      (DOMToDBMS.java:35
      9)
      at de.tudarmstadt.ito.xmldbms.DOMToDBMS.processRelatedClass
      (DOMToDBMS.ja
      va:534)
      at de.tudarmstadt.ito.xmldbms.DOMToDBMS.processChildren
      (DOMToDBMS.java:4
      56)
      at de.tudarmstadt.ito.xmldbms.DOMToDBMS.createClassRow
      (DOMToDBMS.java:35
      8)
      at de.tudarmstadt.ito.xmldbms.DOMToDBMS.processRootElement
      (DOMToDBMS.jav
      a:312)
      at de.tudarmstadt.ito.xmldbms.DOMToDBMS.processRoot
      (DOMToDBMS.java:291)
      at de.tudarmstadt.ito.xmldbms.DOMToDBMS.storeDocument
      (DOMToDBMS.java:241
      )
      at Transfer.toDBMS(Transfer.java:188)
      at Transfer.main(Transfer.java:138)

      Do I miss out some steps ??


      thanks and regards
      Edmond
      > --- In xml-dbms@yahoogroups.com, Ronald Bourret <rpbourret@r...>
      > wrote:
      > > Sorry about the delay in answering. I've been doing a lot of
      other
      > work.
      > >
      > > There are two possible solutions:
      > >
      > > 1) In the try block in initialize, uncomment the following call:
      > >
      > > try
      > > {
      > > // conn.setAutoCommit(false);
      > >
      > > 2) If (1) does not work, then leave that call commented out and
      > also
      > > comment out the call to commit in getHighKey.
      > >
      > > -- Ron
      > >
      > > ray siu wrote:
      > > >
      > > > Hi all,
      > > >
      > > > I am a new user of XML-DBMS. I am currently studying
      > Transfer.java sample, when I run the program, I got the following
      > exception on keyGenerator.initialize(); command:
      > > >
      > > > C:\Downloads\xmldbms\samples>java Transfer -todbms sales.map
      > sales_in.xml
      > > > de.tudarmstadt.ito.xmldbms.KeyException: Can't call commit
      when
      > autocommit=true
      > > > at
      > de.tudarmstadt.ito.xmldbms.helpers.KeyGeneratorImpl.initialize
      (KeyGen
      > > > eratorImpl.java:123)
      > > > at Transfer.toDBMS(Transfer.java:170)
      > > > at Transfer.main(Transfer.java:135)
      > > >
      > > > What does it means of this exception and how can i fix it? I
      > have created the tables on MySQL and also I have created and
      > initialized the XMLDBMSKey table for KeyGeneratorImpl....
      > > >
      > > > Thank you!!
      > > >
      > > > Regards,
      > > > Ray
      > > >
      > > > [Non-text portions of this message have been removed]
      > > >
      > > >
      > > > To post a message, send it to: xml-dbms@yahoogroups.com
      > > > To unsubscribe, send a blank message to: xml-dbms-
      > unsubscribe@yahoogroups.com
      > > > Or join the newsgroup at:
      > news://news.barkto.com/homeless.xml.xml-dbms
      > > >
      > > > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
      > >
      > > --
      > > Ronald Bourret
      > > Programming, Writing, and Research
      > > XML, Databases, and Schemas
      > > http://www.rpbourret.com
    • Ronald Bourret
      Commit is called in two places in XML-DBMS v1.x. First, it is called in KeyGeneratorImpl. You have already commented out the call in that class. Second, it is
      Message 2 of 5 , Mar 9, 2004
      View Source
      • 0 Attachment
        Commit is called in two places in XML-DBMS v1.x. First, it is called in
        KeyGeneratorImpl. You have already commented out the call in that class.
        Second, it is called in the de.tudarmstadt.ito.xmldbms.Map class from
        the Map.commit method. This is the problem you are now seeing.

        One possible cause of this error is that older versions of MySQL do not
        support transactions. This might cause the error shown below. If (a) you
        are only using MySQL and (b) your version of MySQL does not support
        transactions, then comment out the call to conn.commit() in
        Map.commit().

        -- Ron

        ´H¨M wrote:
        >
        > Hi
        >
        > I have follow the instructions as below
        > I have changed the KeygeneratorImp.java within xmldbms.jar
        > and compile a new jar for running transfer .java
        > the result is the same
        >
        > C:\xmldbms\samples>java Transfer -todbms sales.map sales_in.xml
        > java.sql.SQLException: Can't call commit when autocommit=true
        > at com.mysql.jdbc.Connection.commit(Connection.java:1175)
        > at de.tudarmstadt.ito.xmldbms.Map.commit(Map.java:399)
        > at de.tudarmstadt.ito.xmldbms.DOMToDBMS.insertRow
        > (DOMToDBMS.java:707)
        > at de.tudarmstadt.ito.xmldbms.DOMToDBMS.createClassRow
        > (DOMToDBMS.java:35
        > 9)
        > at de.tudarmstadt.ito.xmldbms.DOMToDBMS.processRelatedClass
        > (DOMToDBMS.ja
        > va:534)
        > at de.tudarmstadt.ito.xmldbms.DOMToDBMS.processChildren
        > (DOMToDBMS.java:4
        > 56)
        > at de.tudarmstadt.ito.xmldbms.DOMToDBMS.createClassRow
        > (DOMToDBMS.java:35
        > 8)
        > at de.tudarmstadt.ito.xmldbms.DOMToDBMS.processRootElement
        > (DOMToDBMS.jav
        > a:312)
        > at de.tudarmstadt.ito.xmldbms.DOMToDBMS.processRoot
        > (DOMToDBMS.java:291)
        > at de.tudarmstadt.ito.xmldbms.DOMToDBMS.storeDocument
        > (DOMToDBMS.java:241
        > )
        > at Transfer.toDBMS(Transfer.java:188)
        > at Transfer.main(Transfer.java:138)
        >
        > Do I miss out some steps ??
      Your message has been successfully submitted and would be delivered to recipients shortly.