why hibernate on oracle jdbc fails when postgre driver is present in tomcat lib folder

283 views Asked by At

I've installed in the same Tomcat7 alfresco and some of my applications that use hibernate. In the lib folder I've ojdbc7.jar (for my apps) and postgresql-9.3-1100.jdbc41.jar for alfresco.

Adding the postgre jdbc driver causes error in hibernate query. It seems that the postgre driver corrupts the dialect detection oh hibernate. I get the error:

Caused by: java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended

If i remove the postgre jar file, all works well.

In hibernate(JPA) configuration I don't specify the dialect, because my apps have to run on multiple databases. I get the dialect and the connection from resource from server.xml this is my connection in server.xml:

<Resource auth="Container"
driverClassName="oracle.jdbc.OracleDriver"
maxActive="30"
maxIdle="35"
maxWait="120000"
removeAbandoned="true"
logAbandoned="false"
removeAbandonedTimeout="300"
testOnBorrow="true"
testOnReturn="true"
validationQuery="select 1 from dual"
name="jdbc/IMAGE"
password="PWD123"
type="javax.sql.DataSource"
url="jdbc:oracle:thin:@server:1521:ls01"
username="USER"/>  

Any idea????

1

There are 1 answers

1
K.C. On

See the meaning of the error here.

There is something wrong with the query you executed.