[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

Jonathan Halliday (JIRA) jira-events at lists.jboss.org
Wed May 6 06:25:46 EDT 2009


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

Jonathan Halliday commented on JBTM-419:
----------------------------------------

Indeed if you are compiling against java 1.5 then the compiler is doing the checking for you as I want it to. But the compiler won't safeguard users who build on 1.6, which is why I want the classloader to form a second line of defence. But enough on platform design philosophy, I need to get some code written...

The new version of ConnectionManager does not have a version check. It tries to load the JDBC4 version and if that fails it tries JDBC3. Hopefully that should please everyone except purists like me :-)

The reason we allow loading of older versions is that the dev process rules make it difficult for me to remove functionality between releases. I'd prefer the TransactionalDriver to throw an exception if it can't get a current implementation of the interface, but fortunately management are more customer focused :-)

> 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