I got this to work. The solution is to call the set_config function which can be done as: select set_config('rdkit.do_chiral_sss', 'true', false); This can be done using JDBC statements apis
From: Webster Homer <webster.ho...@milliporesigma.com> Sent: Friday, November 15, 2019 12:18 PM To: Greg Landrum <greg.land...@gmail.com> Cc: rdkit-discuss@lists.sourceforge.net Subject: Re: [Rdkit-discuss] RD Kit Cartridge setting do_chiral_sss flag with Java JDBC I do not believe so. In psql the set statement actually sets a variable in the database session. It’s not SQL. The PostgreSQL Jdbc BaseDataSource class does have methods to set session properties. The problem I discovered is that the DataSource returned by the JNDI lookup does not extend BaseDataSource. JNDI is a Java technology that allows the database link configuration to be separate from the code. It allows us to be able to change the database user, password, host, etc without modifying the application code. This is provided by the application server. I think my solution is simply to default the do_chiral_sss to true. My only concern with that is it could increase the overhead on the search. I think I can set the default on the JDBC URL. It will not be something that the application can modify though. If that is not acceptable I can provide an alternative to JNDI, but our administrators won’t like it. However if I use the PosgreSQL DataSource class for this I will need to use their connection pooling DataSource which is not recommended for production even by Postgresql Regards, Webster From: Greg Landrum <greg.land...@gmail.com<mailto:greg.land...@gmail.com>> Sent: Friday, November 15, 2019 10:16 AM To: Webster Homer <webster.ho...@milliporesigma.com<mailto:webster.ho...@milliporesigma.com>> Cc: rdkit-discuss@lists.sourceforge.net<mailto:rdkit-discuss@lists.sourceforge.net> Subject: Re: [Rdkit-discuss] RD Kit Cartridge setting do_chiral_sss flag with Java JDBC Hi Webster, I am, unfortunately, not familiar enough with the way JDBC works to be able to help here. Isn't there some way you can execute the raw SQL command: "set rdkit.do_chiral_sss=true"? On Thu, Nov 14, 2019 at 9:41 PM Webster Homer <webster.ho...@milliporesigma.com<mailto:webster.ho...@milliporesigma.com>> wrote: I’m trying to understand how to set the rdkit.do_chiral_sss in Java. I would like to call RD Kit structure search from a Java application. However the way RD Kit depends upon setting some values in Postgresql via SET seems to be hard to do using JDBC. I am using JBoss Wildfly to host the application. The normal way to set up the database connection is via JNDI. It is not clear how to set the rdkit.do_chiral_sss variable for the search via JDBC. This does not work Context initCtx = new InitialContext(); ds = (DataSource) initCtx.lookup("java:/jdbc/rdkit-sss"); if (ds instanceof BaseDataSource) { // never true BaseDataSource bds = (BaseDataSource)ds; bds.setProperty("rdkit.do_chiral_sss", structureSearchRequest.isStereoSearch()? "true" : "false"); } else { logger.error("Cannot set RD Kit session variables"); } This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you must not copy this message or attachment or disclose the contents to any other person. If you have received this transmission in error, please notify the sender immediately and delete the message and any attachment from your system. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not accept liability for any omissions or errors in this message which may arise as a result of E-Mail-transmission or for damages resulting from any unauthorized changes of the content of this message and any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not guarantee that this message is free of viruses and does not accept liability for any damages caused by any virus transmitted therewith. Click http://www.merckgroup.com/disclaimer to access the German, French, Spanish and Portuguese versions of this disclaimer. _______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net<mailto:Rdkit-discuss@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you must not copy this message or attachment or disclose the contents to any other person. If you have received this transmission in error, please notify the sender immediately and delete the message and any attachment from your system. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not accept liability for any omissions or errors in this message which may arise as a result of E-Mail-transmission or for damages resulting from any unauthorized changes of the content of this message and any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not guarantee that this message is free of viruses and does not accept liability for any damages caused by any virus transmitted therewith. Click http://www.merckgroup.com/disclaimer to access the German, French, Spanish and Portuguese versions of this disclaimer. This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you must not copy this message or attachment or disclose the contents to any other person. If you have received this transmission in error, please notify the sender immediately and delete the message and any attachment from your system. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not accept liability for any omissions or errors in this message which may arise as a result of E-Mail-transmission or for damages resulting from any unauthorized changes of the content of this message and any attachment thereto. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not guarantee that this message is free of viruses and does not accept liability for any damages caused by any virus transmitted therewith. Click http://www.merckgroup.com/disclaimer to access the German, French, Spanish and Portuguese versions of this disclaimer.
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss