Hi,
we have an independent war in the same tomcat that deploy alfresco wars. This war also uses hibernate but connects with a different database. We are detecting that hibernate is using the same dialect set in Alfresco.
Is Alfresco sharing the hibernate config?
Thanks.
Solved! Go to Solution.
I found the issue. Alfresco is using Hibernate version 3.2.6 wich in class DialectFactory in method buildDialect is saving the "hibernate.dialect" as Java System property. In new versions, this method doesn't save the value in "hibernate.dialect.
public static Dialect buildDialect(Properties props, String databaseName, int databaseMajorVersion) throws HibernateException { String dialectName = props.getProperty("hibernate.dialect"); if (dialectName == null || dialectName.length() == 0) return determineDialect(databaseName, databaseMajorVersion); System.setProperty("hibernate.dialect", dialectName); return buildDialect(dialectName); }
Alfresco is barely using Hibernate - AFAIK the only Hibernate feature still used is the dialect detection and potentially some transaction handling. Alfresco is not actively "sharing" the Hibernate configuration. If you have provided the Alfresco config property "hibernate.dialect" via a Java -D system property, then of course that value will also be available to any other applications running on the same application server, and may influence their behaviour. This would be a configuration error, not an issue in Alfresco itself.
Thanks. Indeed I've seen "hibernate.dialect" is being saved as s java system property. However, I'm not able to find the responsible of that.
I found the issue. Alfresco is using Hibernate version 3.2.6 wich in class DialectFactory in method buildDialect is saving the "hibernate.dialect" as Java System property. In new versions, this method doesn't save the value in "hibernate.dialect.
public static Dialect buildDialect(Properties props, String databaseName, int databaseMajorVersion) throws HibernateException { String dialectName = props.getProperty("hibernate.dialect"); if (dialectName == null || dialectName.length() == 0) return determineDialect(databaseName, databaseMajorVersion); System.setProperty("hibernate.dialect", dialectName); return buildDialect(dialectName); }
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.