2

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????

Chris Travers
  • 25,424
  • 6
  • 65
  • 182
  • After several tests I've understood what is wrong. When the hibernate of alfresco starts, for some reason, overrides the dialect used by the hibernate of other apps. My apps use dialect detected from jdbc connection and is not specified. – lordpixel79 Dec 05 '13 at 14:36

1 Answers1

0

See the meaning of the error here.

There is something wrong with the query you executed.

K.C.
  • 2,084
  • 2
  • 25
  • 38
  • No there is no error in connection. When i remove alfresco webapp without changing nothing other, all works perfectly. – lordpixel79 Dec 05 '13 at 14:40