Re: JDBC Statement Timeout

2014-10-14 Thread Malcolm Edgar
Hi Guys, I ended up wrapping the JNDIDataSourceFactory, DataSource and Connection classes and configuring this in the domain configuration file. The wrapped Connection class sets the queryTimeout when the Statement objects are created. This flushed out the errors, which we are now working to

Re: Access to JDBC Connection

2014-10-14 Thread Lon Varscsak
Okay, that's the issue (not calling close()). I thought what I was getting back was a real JDBC Connection, but it looks like I'm getting back a ConnectionWrapper, which when closed, returns the connection to pool. I can do something conditionally with this. Thanks, Lon On Tue, Oct 14, 2014 at

Re: Access to JDBC Connection

2014-10-14 Thread Lon Varscsak
That's basically what I'm doing... DataSource dataSource = serverRuntime().getDataSource(dataNodeName); try { return dataSource.getConnection(); } catch (SQLException sqe) { throw new RuntimeException(sqe); } No exception is being throw. My query executes (a simpl

Re: Access to JDBC Connection

2014-10-14 Thread Andrus Adamchik
Hi Lon, Some code samples showing how you get and release connection would help to understand your problem better. But... You can actually bypass dealing with the internals of Cayenne stack and work with DataSource as you would in a straight JDBC application: ServerRuntime r = ... DataSource d

Re: JDBC Statement Timeout

2014-10-14 Thread Andrus Adamchik
Yep, that's one way of doing it, though requiring to use a custom query everywhere. A DI alternative of the same solution is to do something like this in a custom Module: binder.bind(OracleSniffer.class).to(MyOracleSniffer.class); MyOracleSniffer would implement DbAdapterDetector which is a d

Access to JDBC Connection

2014-10-14 Thread Lon Varscsak
Hey all, I have some code that executes some raw SQL and historically (with EOF) I just get the connection that would normally be used for that editing context. No problems. So I'm trying to implement that similarly in Cayenne, and I'm getting the DataNode's DataSource's connection, and it works