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 decorator of OracleSniffer. It will return a DbAdapter decorator of the OracleAdapter, overriding DbAdapter.getAction(..) to set timeouts. And yes, we need a better way to do this. But at least this one is non-invasive in that it doesn't require you to change idiomatic Cayenne code elsewhere. Andrus On Oct 13, 2014, at 3:00 PM, Emanuele Maiarelli <[email protected]> wrote: > http://cayenne.195.n3.nabble.com/query-timeout-needed-td1070.html > > The link explains the solution for cayenne 1.2. > > You can try with cayenne 3.1 being aware that packages named > org.objectstyle.* have been renamed as org.apache.* > > > > 2014-10-13 4:50 GMT+02:00 Malcolm Edgar <[email protected]>: > >> Hi All, >> >> I am having some deadlock issues with the Oracle database, and want to be >> able to set the JDBC statement timeout. >> >> From what I understand this isn't supported in Cayenne 3.1, and I am after >> advice on the best way to do this in a Cayenne context. >> >> >> http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#setQueryTimeout%28int%29 >> >> Thanks in advance for any help. >> >> regards Malcolm Edgar >>
