You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Enrico Olivelli <eo...@gmail.com> on 2012/07/23 08:23:41 UTC

ManagedDataSource on jdk7

Hi,
today I updated OpenEJB trunk and it does not compile anymore on JDK7
it is because of new classes that wrap JDBC DataSource and Connection

I think these new methods won't be used in JavaEE6 App (because JavEE6 
requires jdk6 and "portable" apps can't use jdk7 specific library functions)
personally I always implemented them with a 'throw new SQLException("not 
supported yet")'

consider adding in 
org.apache.openejb.resource.jdbc.managed.ManagedDataSource.java

//no @Override if you want to compile on JDK6
  public Logger getParentLogger() throws SQLFeatureNotSupportedException {
// use reflection if you want to compile on JDK6 or throw new 
SQLFeatureNotSupportedException...
         return delegate.getParentLogger();
     }


and these lines to 
org.apache.openejb.resource.jdbc.managed.ManagedConnection.java

     public void setSchema(String schema) throws SQLException {
         delegate.setSchema(schema);
     }

     public String getSchema() throws SQLException {
         return delegate.getSchema();
     }

     public void abort(Executor executor) throws SQLException {
         delegate.abort(executor);
     }

     public void setNetworkTimeout(Executor executor, int milliseconds) 
throws SQLException {
         delegate.setNetworkTimeout(executor, milliseconds);
     }

     public int getNetworkTimeout() throws SQLException {
         return delegate.getNetworkTimeout();
     }



  - Enrico


Re: ManagedDataSource on jdk7

Posted by Enrico Olivelli <eo...@gmail.com>.
I was trying Quartz clustered configuration but I have some problem 
with org.quartz.jobStore.nonManagedTXDataSource property
I did a svn update to have code updated to HEAD....
no problem now I have to come back to my everyday work, I think I'll try 
tomorrow

this was my config, MyAppDB is "JtaManaged true" and MyAppDBNonJta is 
"JtaManaged false"
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT
org.quartz.jobStore.dataSource=MyAppDB
org.quartz.dataSource.MyAppDB.jndiURL=jdbc/MyAppDB
org.quartz.jobStore.nonManagedTXDataSource=MyAppDBNonJta
org.quartz.dataSource.MyAppDBNonJta.jndiURL=jdbc/MyAppDBNonJta
org.quartz.jobStore.isClustered=true

Il 23/07/2012 08:29, Romain Manni-Bucau ha scritto:
>
> Yep thought of it too but was in a dirty state to push any change. 
> Does it urge?
>
> - Romain
>


Re: ManagedDataSource on jdk7

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Yep thought of it too but was in a dirty state to push any change. Does it
urge?

- Romain
Le 23 juil. 2012 08:24, "Enrico Olivelli" <eo...@gmail.com> a écrit :

> Hi,
> today I updated OpenEJB trunk and it does not compile anymore on JDK7
> it is because of new classes that wrap JDBC DataSource and Connection
>
> I think these new methods won't be used in JavaEE6 App (because JavEE6
> requires jdk6 and "portable" apps can't use jdk7 specific library functions)
> personally I always implemented them with a 'throw new SQLException("not
> supported yet")'
>
> consider adding in org.apache.openejb.resource.**jdbc.managed.**
> ManagedDataSource.java
>
> //no @Override if you want to compile on JDK6
>  public Logger getParentLogger() throws SQLFeatureNotSupportedExceptio**n
> {
> // use reflection if you want to compile on JDK6 or throw new
> SQLFeatureNotSupportedExceptio**n...
>         return delegate.getParentLogger();
>     }
>
>
> and these lines to org.apache.openejb.resource.**jdbc.managed.**
> ManagedConnection.java
>
>     public void setSchema(String schema) throws SQLException {
>         delegate.setSchema(schema);
>     }
>
>     public String getSchema() throws SQLException {
>         return delegate.getSchema();
>     }
>
>     public void abort(Executor executor) throws SQLException {
>         delegate.abort(executor);
>     }
>
>     public void setNetworkTimeout(Executor executor, int milliseconds)
> throws SQLException {
>         delegate.setNetworkTimeout(**executor, milliseconds);
>     }
>
>     public int getNetworkTimeout() throws SQLException {
>         return delegate.getNetworkTimeout();
>     }
>
>
>
>  - Enrico
>
>