Topic
4 replies Latest Post - ‏2012-11-21T15:35:24Z by Jacek_Laskowski
Jacek_Laskowski
Jacek_Laskowski
133 Posts
ACCEPTED ANSWER

Pinned topic Why doesn't jpa-2.0 feature enable jdbc-4.0?

‏2012-11-21T13:29:11Z |
Hi,

I've been stunned when I noticed that the jpa-2.0 feature doesn't enable jdbc-4.0. What are the reasons to make the decision?

Could there be a use case in which jpa-2.0 doesn't need jdbc-4.0? I thought JPA is (based upon) JDBC.

Jacek
Japila :: verba docent, exempla trahunt
  • SystemAdmin
    SystemAdmin
    590 Posts
    ACCEPTED ANSWER

    Re: Why doesn't jpa-2.0 feature enable jdbc-4.0?

    ‏2012-11-21T14:47:32Z  in response to Jacek_Laskowski
    Hi Jacek,
    There are some scenarios where jpa-2.0 can be used without the jdbc-4.0 feature, but we did discuss this a while ago in the team and decided that including the jdbc-4.0 feature would be more useful for the majority of scenarios. If you look at the most recent driver (on 'downloads') you'll see it has now been added. So - we agree with your feedback!
    Regards, Alex.
    • Jacek_Laskowski
      Jacek_Laskowski
      133 Posts
      ACCEPTED ANSWER

      Re: Why doesn't jpa-2.0 feature enable jdbc-4.0?

      ‏2012-11-21T15:13:20Z  in response to SystemAdmin
      Hi Alex,

      Thanks for the response.

      For the purpose of better self-learning could you share what the other scenarios were? I can't think of any now and you made me even curious.

      Jacek
      Japila :: verba docent, exempla trahunt
      • SystemAdmin
        SystemAdmin
        590 Posts
        ACCEPTED ANSWER

        Re: Why doesn't jpa-2.0 feature enable jdbc-4.0?

        ‏2012-11-21T15:33:30Z  in response to Jacek_Laskowski
        Hi Jacek,

        Sure - the scenario we discussed was a persistence unit that uses connection properties instead of using a JDBC data source. When using connection properties, the provider uses the JDBC Driver API (which is included in the JRE) directly instead of using data source support as provided by the jdbc-4.0 feature. We debated the trade-off between configuring unneeded function for that (perhaps unusual) scenario versus the annoyance of debugging jpa failures when the jdbc feature was needed but not configured, and in the end applied the 80/20 rule and added the jdbc feature to jpa.

        Regards, Alex.