Quantcast
Channel: Adobe Community : All Content - ColdFusion
Viewing all articles
Browse latest Browse all 5979

Coldfusion datasource isolation level (tomcat resource?)

$
0
0

Hello all,

I'm hoping someone can help me with a problem I'm having.  I know some of the problems I'm having are due to poor application design, but this was all stuff done before I started working on the application and changing it is not likely any time soon.  That said... we are currently running ColdFusion 9 on a fairly large application.  We never upgraded to 10 because of a problem with being able to set the isolation level on datasource connections to the database.  Since CF 2016 released recently, I decided to play with this some again.  We are running an informix database and so have their jdbc drivers, and I have them added to the class path.  All of that works fine.

 

I can add the datasource directly in the coldfusion administrator, and it works, accept for the isolation level.  The way the application was designed and written it requires the default isolation level to be set to dirty read (read uncommitted) on some of the datasources.  In CF9 we can configure this in jrun-resources.xml by adding <isolation-level>READ_UNCOMMITTED</isolation-level> to the datasource.  There is no way to do this in the coldfusion administrator that I can find, and haven't found anyway to add it in the neo-datasources.xml file.

 

So I found out about Tomcat JNDI datasources. I was able to get a working datasource by adding a resource container in context.xml and a reference to it in web.xml, then add it through the coldfusion administrator as a J2EE datasource pointed at java:comp/env/jdbc/datasource.  It supports defaultTransactionIsolation="READ_UNCOMMITTED" as a paramter on the resource so it resolves that issue.  Initially this is fine, as long as I add the username and password to the Resource in context.xml.  This brings the 2nd problem, as much as I hate that this is done, our current set up does a user based authentication on every query.  So every cfquery tag has username  and password attributes, accept for a couple of datasources that do datasource based authentication.  The Tomcat JNDI datasource is apparently based on a BasicDataSource factory from Tomcat, which errors with the username and password being specified on the query tag (or even in coldfusions administrator).  It says that it's not supported by BasicDataSource.  I found another org.apache.jdbc.pool.DataSourceFactory, but if I try to specify that as the factory on the Resource, the coldfusion errors with unable to find the datasource when try to add or modify it through the administrator.

 

The last part of the problem is an IBM problem.  There is supposed to be an Informix environment setting IFX_ISOLATION_LEVEL, but it seems to ignore that environment variable if specified on the jdbc url.

 

Is there a way to do what we need to accomplish in CF10+ (have a datasource with a default isolation level specified and allow authentication from the query tags).

 

Any advice or help on ways to resolve this situation would be greatly appreciated.


Viewing all articles
Browse latest Browse all 5979

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>