[jbossts-issues] [JBoss JIRA] Commented: (JBTM-419) Hardcoded "1.5" java version check in com\arjuna\ats\internal\jdbc\ConnectionManager.java won't work on Java 1.6

Mauro Molinari (JIRA) jira-events at lists.jboss.org
Wed May 6 03:33:56 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBTM-419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12465931#action_12465931 ] 

Mauro Molinari commented on JBTM-419:
-------------------------------------

Sorry Jonathan, I can't get on it...

I agree on the fact that JDBC4 Connection implementations will fail at class load time on a JRE 5 because the JRE 5 libraries do not contain certain classes.

However, I can't understand why a JDBC3 implementation wouldn't RUN on JRE6 exactly like a JDBC2 implementation does... If you compile your JDBC3-compliant classes with Java5's javac, you can use them at runtime with a Java 6 JRE without problems, unless you try to use them "as if" they were JDBC4 implementations.

We use JDBC3 drivers under Java6 JRE all the time without problems... JBossTS is also running perfectly under Java6, BUT it's using its JDBC2 implementations because of that hard-coded version check.

> Hardcoded "1.5" java version check in com\arjuna\ats\internal\jdbc\ConnectionManager.java won't work on Java 1.6
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: JBTM-419
>                 URL: https://jira.jboss.org/jira/browse/JBTM-419
>             Project: JBoss Transaction Manager
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: JTA
>    Affects Versions: 4.4.0.GA
>         Environment: Sun's J2SE DevKit 1.6u10
>            Reporter: Sergey Proskurnya
>            Assignee: Jonathan Halliday
>            Priority: Minor
>             Fix For: 4.7.0
>
>
> There is a hard-coded version check in com.arjuna.ats.internal.jdbc.ConnectionManager in "create (String dbUrl, Properties info)" method:
> --------------------------------------------------------------------------------------------------------------------------
> ...
> line 116:
> if(System.getProperty("java.specification.version").equals("1.5"))
> 	{
> 		// the 1.5 (JDBC3) wrapper version is loaded dynamically because classloading
> 		// it on earlier versions of the platform is not possible.
>         ....
> }
> --------------------------------------------------------------------------------------------------------------------------
> That piece of code will not work correctly on Java 1.6, because System.getProperty("java.specification.version") returns "1.6" on Java 1.6.
> It is needed to parse the result of System.getProperty("java.specification.version") and compare major and minor versions separately.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jbossts-issues mailing list