• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Switching from ojdbc6.jar to ojdbc7.jar

 
Ranch Hand
Posts: 153
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
we use an Oracle 11g Database. Up to now we have used ojdbc6.jar as the jdbc driver. The customer wishes to update to ojdbc7.jar.
With Hibernate 4.3, ojdbc6.jar and
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
the application works as expected. However when we switch to ojdbc7.jar

does not work any more. No exception is thrown. Simply an empty List is returned.
When I trace the Hibernate SQL with bound parameters and execute the SQL directly it returns the expected result.
I have tried to update to Hibernate 5.3 and
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle12cDialect" />
to no avail. The error still persists.
Any ideas how to fix this?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's a way to configure Hibernate to log the exact SQL statements it's issuing to the database. I don't remember exactly what the setting is right now, but you can look it up and enable it, so that you can see what Hibernate exactly is doing, and then you can check if it's doing something that is not correct.
 
Markus Schmider
Ranch Hand
Posts: 153
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have enabled logging of hibernate sql for log4j with


When I trace the Hibernate SQL with bound parameters and execute the SQL directly it returns the expected result.
DEBUG SQL - select rechtsvorg0_.nr as nr1_49_, rechtsvorg0_.kurzname as kurzname2_49_, rechtsvorg0_.langname as langname3_49_, rechtsvorg0_.entscheidungArt as entscheidungArt4_49_, rechtsvorg0_.gueltigBis as gueltigBis5_49_, rechtsvorg0_.gueltigVon as gueltigVon6_49_, rechtsvorg0_.kategorieNr as kategorieNr7_49_, rechtsvorg0_.objektArt as objektArt8_49_, rechtsvorg0_.refNr as refNr9_49_ from WR.WR_SL_RECHTSVORGANG rechtsvorg0_ where rechtsvorg0_.kategorieNr>=? and rechtsvorg0_.kategorieNr<? and rechtsvorg0_.gueltigVon>=? order by rechtsvorg0_.langname
TRACE BasicBinder - binding parameter [1] as [INTEGER] - [110]
TRACE BasicBinder - binding parameter [2] as [INTEGER] - [120]
TRACE BasicBinder - binding parameter [3] as [DATE] - [Tue Jan 01 10:15:52 CET 2013]
When I run



from SQL Developer I get the expected result. So it seems that Hibernate generates valid SQL.

After playing around I have found that apparently ojdbc7 does not work properly with date comparisons using >=.
After changing to >

and adusting the gueltigVon Parameter accordingly the application works as expected again.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic