TransferException

User 870ab5b546

02-02-2007 21:01:04

Hi,





We appear to have successfully upgraded our tables, but now we've run into a new error.





When we try to import certain Qs into our database, we get this error:





Code:
MolTable.java:importMol: mol name is --; table name is user_misc_molecules_v1


chemaxon.jchem.db.TransferException: Data size bigger than max size for this type: 4909


   at com.prenhall.epoch.db.chem.MolTable.importMol(MolTable.java:174)


   at com.prenhall.epoch.db.chem.MolTable.addMol(MolTable.java:258)


   at com.prenhall.epoch.db.ProblemStoreWriter.addProblem(ProblemStoreWriter.java:573)






The data type of the relevant table column is LONG RAW. The data we are trying to import is:





Code:
<?xml version="1.0" ?>


<MDocument>


  <MRectangle id="o1">


    <MPoint x="-12.833333492279053" y="8.108334064483643" />


    <MPoint x="-4.375000029802322" y="8.108334064483643" />


    <MPoint x="-4.375000029802322" y="1.8666670322418213" />


    <MPoint x="-12.833333492279053" y="1.8666670322418213" />


  </MRectangle>


  <MChemicalStruct>


    <molecule molID="m1">


      <atomArray


          atomID="a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21"


          elementType="Cl Cl Cl C H O O Cl Cl Cl C C C R C R C Cl Cl C Cl"


          radical="0 0 0 0 0 monovalent monovalent 0 0 0 monovalent 0 0 0 monovalent 0 0 0 0 0 0"


          sgroupRef="0 0 0 0 0 0 0 0 0 0 0 0 0 sg1 0 sg2 0 0 0 0 0"


          x2="-10.09166669845581 -11.63166669845581 -10.09166669845581 -10.09166669845581 -8.551666698455811 -7.116666793823242 -5.576666793823242 2.484999904632568 0.944999904632569 2.484999904632568 2.484999904632568 6.125 6.8950000000000005 8.435 0.4433333214124051 1.9833333214124043 -0.3266666785875949 -1.866666678587595 -3.406666678587595 -1.866666678587595 -1.866666678587595"


          y2="5.915000476837158 4.375000476837158 2.835000476837158 4.375000476837158 4.375000476837158 6.708333492279053 6.708333492279053 6.498333492279052 4.958333492279053 3.4183334922790536 4.958333492279053 3.558333396911621 4.892012518739657 4.892012518739657 -3.4054401973565565 -3.4054401973565565 -4.739119319184592 -3.199119319184592 -4.739119319184592 -4.739119319184592 -6.279119319184592"


          />


      <bondArray>


        <bond atomRefs2="a4 a1" order="1" />


        <bond atomRefs2="a4 a2" order="1" />


        <bond atomRefs2="a4 a3" order="1" />


        <bond atomRefs2="a4 a5" order="1" />


        <bond atomRefs2="a6 a7" order="1" />


        <bond atomRefs2="a11 a8" order="1" />


        <bond atomRefs2="a11 a9" order="1" />


        <bond atomRefs2="a11 a10" order="1" />


        <bond atomRefs2="a12 a13" order="2" />


        <bond atomRefs2="a17 a15" order="1" />


        <bond atomRefs2="a17 a20" order="1" />


        <bond atomRefs2="a20 a18" order="1" />


        <bond atomRefs2="a20 a19" order="1" />


        <bond atomRefs2="a20 a21" order="1" />


        <bond atomRefs2="a15 a16" order="1" />


        <bond atomRefs2="a13 a14" order="1" />


      </bondArray>


      <molecule id="sg1" role="SuperatomSgroup" title="Ph" molID="m2">


        <atomArray


            atomID="a22 a23 a24 a25 a26 a27"


            elementType="C C C C C C"


            attachmentPoint="1 0 0 0 0 0"


            x2="8.691666603088379 10.025345724916416 10.025345724916416 8.69166660308838 7.357987481260344 7.357987481260343"


            y2="3.418333492279052 4.188333492279052 5.728333492279052 6.498333492279052 5.728333492279054 4.188333492279053"


            />


        <bondArray>


          <bond atomRefs2="a22 a23" order="2" />


          <bond atomRefs2="a22 a27" order="1" />


          <bond atomRefs2="a23 a24" order="1" />


          <bond atomRefs2="a24 a25" order="2" />


          <bond atomRefs2="a25 a26" order="1" />


          <bond atomRefs2="a26 a27" order="2" />


        </bondArray>


      </molecule>


      <molecule id="sg2" role="SuperatomSgroup" title="Ph" molID="m3">


        <atomArray


            atomID="a28 a29 a30 a31 a32 a33"


            elementType="C C C C C C"


            attachmentPoint="1 0 0 0 0 0"


            x2="2.2399999245007827 3.57367904632882 3.57367904632882 2.2399999245007844 0.9063208026727487 0.9063208026727478"


            y2="-4.8791192238171615 -4.10911922381716 -2.569119223817161 -1.7991192238171614 -2.569119223817159 -4.10911922381716"


            />


        <bondArray>


          <bond atomRefs2="a28 a29" order="2" />


          <bond atomRefs2="a28 a33" order="1" />


          <bond atomRefs2="a29 a30" order="1" />


          <bond atomRefs2="a30 a31" order="2" />


          <bond atomRefs2="a31 a32" order="1" />


          <bond atomRefs2="a32 a33" order="2" />


        </bondArray>


      </molecule>


    </molecule>


  </MChemicalStruct>


  <MRectangle id="o3">


    <MPoint x="-0.23333333432674408" y="7.641666889190674" />


    <MPoint x="9.449999809265137" y="7.641666889190674" />


    <MPoint x="9.449999809265137" y="2.3333332538604736" />


    <MPoint x="-0.23333333432674408" y="2.3333332538604736" />


  </MRectangle>


  <MRectangle id="o4">


    <MPoint x="-5.6583333015441895" y="-2.0999999046325684" />


    <MPoint x="3.7916667461395264" y="-2.0999999046325684" />


    <MPoint x="3.7916667461395264" y="-7.291666507720947" />


    <MPoint x="-5.6583333015441895" y="-7.291666507720947" />


  </MRectangle>


  <MPolyline id="o5" headLength="0.8" headWidth="0.5">


    <MRectanglePoint pos="5" rectRef="o1" />


    <MRectanglePoint pos="7" rectRef="o3" />


  </MPolyline>


  <MPolyline id="o6" headLength="0.8" headWidth="0.5">


    <MRectanglePoint pos="6" rectRef="o3" />


    <MRectanglePoint pos="4" rectRef="o4" />


  </MPolyline>


</MDocument>








Here's the relevant code. The line that fails is uh.execute(true).





Code:
    private int importMol(Connection dbcon, String struct, String name)


            throws SQLException, TransferException {


        if (name.equals("")) name = "null"; // can't store empty string in DB


        System.out.println("MolTable.java:importMol: mol name is " + name


            + "; table name is " + tablename);


        if (name.length() > StaticLimits.MAX_MOL_NAME_LENGTH) {


            System.out.println("MolTable.java: mol_name is too long: " +


                name.length() + "; maximum is " + StaticLimits.MAX_MOL_NAME_LENGTH);


            name = name.substring(0, StaticLimits.MAX_MOL_NAME_LENGTH);


        }


        ConnectionHandler conh = new ConnectionHandler();


        try {


            conh.setConnection(dbcon);


            UpdateHandler uh = new UpdateHandler(conh, UpdateHandler.INSERT,


                    username + "." + tablename, "mol_name");


            try {


                // uh.setValuesForFixColumns(struct); // deprecated since 3.1.2


                uh.setStructure(struct); // in API from 3.1.2


                uh.setValueForAdditionalColumn(1, name);


                //System.out.println("Moltable:importMol about to import into "


                //  + username + "." + tablename + " this struct: " + struct);


                return uh.execute(true);


            } finally {


                uh.close();


            }


        } catch (Exception e) {


            throw new TransferException(e.getMessage());


        } finally {


            conh.close();


        }


    } // importMol






Any ideas? I should mention that we see this bug in both Prentice-Hall installations of ACE, but not in the UK installation.

ChemAxon e274e1bada

05-02-2007 23:27:57

Hi Bob,





I have reproduced this error, now I am debugging it.


Could you tell me which JDBC driver were you using when this error occured? (9.2 original or a recommended newer version?)





Best regards,


Edvard

User 870ab5b546

05-02-2007 23:55:35

The same system is being used as was described in the jcman post.

ChemAxon e274e1bada

06-02-2007 11:03:22

You should try to upgrade your JDBC driver to latest, what I recommended in previous topic http://www.chemaxon.com/forum/ftopic2540.html.


(If you did it for JChem Manager, should do it for your application server too)





Best regards,


Edvard

User 870ab5b546

06-02-2007 11:29:11

We are using a 9.2.0.1.0 driver on our UK installation, and we are not seeing the TransferException here. Why would nearly the same driver create the problem at Prentice-Hall?

User 870ab5b546

07-02-2007 00:13:02

The change did the trick. Not sure why it wasn't also needed at our UKY installation, but we'll leave that question for another day.

ChemAxon e274e1bada

07-02-2007 20:53:06

Hi Bob,





We have changed our code in JChem importer, so that will be compatible with older Oracle JDBC drivers from next release.


Thank you for bug report.





Best regards,


Edvard