UpdateHandler not updating certain smiles strings

User 6686efeff7

17-04-2009 13:47:33

UpdateHandler not updating certain smiles strings  the update either

* Throws a ClassCastException or
* The update thread blocks indefinitely

the following code is apart of a unit test I wrote to test this, I will also add the the full Unit test to this thread

    public void testAddSmiles1() throws Exception
    {
        //  this succeeds
        addSmiles("c1ccccc1");
    }
   
    public void testAddSmiles2() throws Exception
    {
        //  throws a ClassCastException
        addSmiles("CCCCC[C@H](OO)\\\\C=C\\\\C=C/CCCCCCCC(O)=O");
    }
   
    public void testAddSmiles3() throws Exception
    {
        //  this test blocks
        addSmiles("[H]C(\\\\C=C/CCCCCCCC(O)=O)=C1O[C@H]1C\\\\C=C/CC");
    }
   
    private void addSmiles(String smiles) throws Exception
    {
        assert ( SMILESRecognizer.canBeSMILES( smiles ) );
        UpdateHandler handler = new UpdateHandler();
        handler.init( connectionHandler, UpdateHandler.INSERT, TABLE_NAME, null);
        handler.setStructure( smiles );
        handler.execute();
    }


 


JChem version 5.1.2


Java versions tested 1.4 and 1.6

ChemAxon 9c0afc9aaf

17-04-2009 13:51:36

Hi,


 


Could younm let us know the JChem version you are using please ?


Could you also tell us the type of RDMS you are using ?


 


Best regards,


 


Szilard


 

User 6686efeff7

17-04-2009 14:08:08

JChem version 5.1.2


HSQLDB version 1.8

ChemAxon 9c0afc9aaf

17-04-2009 17:50:24

Hi,


 


We could reproduce the problem.


The latter two SMILES strings are invalid beacuse of the double backslash "\\"  ("\\\\" in the Java code).


If you substitute them with a single "\" they work fine.


We will change the code and throw a meaningful exception for similar cases in the future.


Best regards,


Szilard


 

User 6686efeff7

20-04-2009 10:44:47










Szilard wrote:

Hi,


 


We could reproduce the problem.


The latter two SMILES strings are invalid beacuse of the double backslash "\\"  ("\\\\" in the Java code).


If you substitute them with a single "\" they work fine.


We will change the code and throw a meaningful exception for similar cases in the future.


Best regards,


Szilard


 




Hi Szilard,

Thanks for your reply. Ok for now I am adding code to detect double backslashes in my code

Regards,

Wiraj