Datasource autoCommit

122 views
Skip to first unread message

Dave Worth

unread,
Oct 29, 2014, 3:23:24 PM10/29/14
to ra...@googlegroups.com
Hi - I"m new to Railo and have searched high and low.

Added Hive2 jdbc drivers.
Seems like it is connecting and then failing with:
enabling autocommit is not supported
at org.apache.hive.jdbc.HiveConnection.setAutoCommit(HiveConnection.java:902):902


Is there a way to override the autoCommit setting?

Something like
autoCommit=false

I'm not sure where this would be done.

Thanks for any pointers.

Dave

Michael Offner

unread,
Oct 30, 2014, 2:44:44 AM10/30/14
to ra...@googlegroups.com
Every query not executed within <cftransaction> is set to auto commit, otherwise you would have a mess.
So best try to use cftransaction 

Micha
--
Did you find this reply useful?  Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/460c4f5c-9775-4a68-874a-e33896ed528e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
/micha

Michael Offner CTO Railo Technologies GmbH

Dave Worth

unread,
Oct 30, 2014, 9:28:06 AM10/30/14
to ra...@googlegroups.com
Thanks for the reply.
The hive jdbc only supports data retrieval queries so the concept of transactions and commits isn't meaningful.  Other apps seem to ignore the autocommit response, treating it  as an INFO type of error, not an error that terminates execution,

I should have mentioned that this error also occurs when verifying the datasource connection.
I then tried using <cftransaction> in a cfm file on a simple query but that didn't help either.

Looking thru the github repository I found this release note.
Does this mean I can set it somehow?

08/15/2012 - jTDS 1.2.6 released

Changes from jTDS 1.2.5

08/15/2012 - Holger Rehn
o Applied patch [3048203] by amallon, adding a new 'autoCommit' connection
property to override the auto commit default for newly created connections.

Igal @ getRailo.org

unread,
Oct 30, 2014, 9:36:55 AM10/30/14
to ra...@googlegroups.com
are you using the jTDS driver?  the notes you cited were copied for reference purposes from the jTDS release notes and have nothing to do with other drivers, so if you are using the Hive2 drivers as you wrote in your previous email this does not affect you in any way.

if you want to add options to the connection string you can do it via the Admin or in the xml config files (railo-server.xml or railo-web.cfm.xml)

For more options, visit https://groups.google.com/d/optout.

-- 
Igal Sapir
Railo Core Developer
http://getRailo.org/

Dave Worth

unread,
Oct 30, 2014, 9:44:31 AM10/30/14
to ra...@googlegroups.com
Ahh sorry - didn't realize that was for another driver. 

I've tried changing the URL connection string.  But as I understand it, I need railo to stop trying to setautoCommit=true (is there a setting for this?) when establishing the connection, or to ignore the error it gets back from the driver that it isn't supported.
Hopefully I don't have to do my own custom compile.

Michael Offner

unread,
Oct 30, 2014, 10:01:29 AM10/30/14
to ra...@googlegroups.com
no there is no setting for this, i was assuming that maybe <cftransaction> would help, it looks like (without checking the code) that Railo already sets that value when it gets a connection from connection pool.
What is the java stacktrace you get?
One solution could be to write a proxy for the jdbc driver that does not forward the autocommit setting.

Micha



For more options, visit https://groups.google.com/d/optout.

Dave Worth

unread,
Oct 30, 2014, 10:39:13 AM10/30/14
to ra...@googlegroups.com
Thanks again for the reply.

I'm not sure where to begin for creating a proxy for the jdbc driver.

Stack trace below:

enabling autocommit is not supported
  at org.apache.hive.jdbc.HiveConnection.setAutoCommit(HiveConnection.java:902):902
  at railo.runtime.db.driver.ConnectionProxy.setAutoCommit(ConnectionProxy.java:238):238
  at railo.runtime.db.DatasourceConnectionPool.loadDatasourceConnection(DatasourceConnectionPool.java:74):74
  at railo.runtime.db.DatasourceConnectionPool.getDatasourceConnection(DatasourceConnectionPool.java:65):65
  at railo.runtime.PageContextImpl._getConnection(PageContextImpl.java:3022):3022
  at railo.runtime.db.DatasourceManagerImpl.getConnection(DatasourceManagerImpl.java:53):53
  at railo.runtime.tag.Query.executeDatasoure(Query.java:680):680
  at railo.runtime.tag.Query.doEndTag(Query.java:531):531
  at test_cfm$cf.call(/Users/daveworth/Downloads/railo-express-4.2.1.008-macosx/webapps/ROOT/test.cfm:4):4
  at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:909):909
  at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:861):861
  at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:206):206
  at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:18):18
  at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2212):2212
  at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2179):2179
  at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:331):331
  at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:29):29
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:790):790
  at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:738):738
  at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:551):551
  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143):143
  at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568):568
  at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221):221
  at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111):1111
  at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:478):478
  at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183):183
  at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045):1045
  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141):141
  at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:199):199
  at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109):109
  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97):97
  at org.eclipse.jetty.server.Server.handle(Server.java:462):462
  at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:279):279
  at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232):232
  at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534):534
  at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607):607
  at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536):536
  at java.lang.Thread.run(Thread.java:745):745

Michael Offner

unread,
Oct 30, 2014, 11:08:42 AM10/30/14
to ra...@googlegroups.com
Like you can see here
Railo set autocommit to true for every connection it gets from the connection pool. even they are later only used with <cftransaction>, that is something we could maybe optimize..., i mean that Railo only set autocommit when necessary.

Micha



For more options, visit https://groups.google.com/d/optout.

Dave Worth

unread,
Oct 30, 2014, 12:59:44 PM10/30/14
to ra...@googlegroups.com
That would be amazing if it could be added as a check box in the Other JDBC web form.  Enable AutoCommit  

I'll keep an eye out for any changes posted.

I'll have to find a work around in the mean time.

Thanks
Reply all
Reply to author
Forward
0 new messages