[Hibernate-JIRA] Created: (HHH-4746) executeUpdate (Query object) on entity that have joined-subclass, perform an immediate commit (updates commits before calling transaction.commit() )
by Pierpaolo Moio (JIRA)
executeUpdate (Query object) on entity that have joined-subclass, perform an immediate commit (updates commits before calling transaction.commit() )
----------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-4746
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4746
Project: Hibernate Core
Issue Type: Bug
Components: query-hql
Affects Versions: 3.3.2, 3.2.7, 3.2.3
Environment: MySql 5.1, hibernate-3.3.2.GA (hibernate-core-3.2.3.ga, hibernate-3.2.7.ga)
Reporter: Pierpaolo Moio
Attachments: testCase.rar
I'm using the following statements:
*SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();*
*try {*
*sessionFactory.getCurrentSession().beginTransaction();*
*Query q = sessionFactory.getCurrentSession().createQuery("update SceneElement sceneElement set*
*sceneElement.sequence=(-1)*sceneElement.sequence where sceneElement.scene.id=?").setParameter(0, 144);*
*q.executeUpdate();*
*if (true) throw new RuntimeException("I'm forcing exception: I want you rollback!");*
*// unreacheable statement !!*
*sessionFactory.getCurrentSession().getTransaction().commit();*
*}catch (Throwable e) {*
*sessionFactory.getCurrentSession().getTransaction().rollback();*
*e.printStackTrace();*
*} finally {*
*sessionFactory.getCurrentSession().close();*
*}*
The Entity *SceneElement* contains two *joined-subclass*.
This is a snippet of hibernate sql output (hibernate use temporary table on mysql):
*update scene_element set sequence=-1*sequence where ( id ) IN ( select id from HT_scene_element )*
This update *commit outside the transaction*, so I can't rollback in case of exception.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 2 months
[Hibernate-JIRA] Created: (HHH-4745) /hibernate.cfg.xml not found
by Mike Bishop (JIRA)
/hibernate.cfg.xml not found
----------------------------
Key: HHH-4745
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4745
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2
Environment: Windows XP; maven; hibernate-distribution-3.3.2.GA; hibernate-entitymanager-3.4.0.GA
MS SQL Server 2008 Developer. sqljdbc4.jar (microsoft sqljdbc_2)
Reporter: Mike Bishop
no matter where I put it, no matter what the classpath, sessionFactory cannot find hibernate.cfg.xml.
Here is the class path -
.;C:\my-app\target;C:\Hibernate\hibernate-distribution-3.3.2.GA;C:\Hibernate\hibernate-distribution-3.3.2.GA\lib\required;C:\Hibernate\hibernate-annotations-3.4.0.GA;C:\Hibernate\hibernate-entitymanager-3.4.0.GA;C:\jdbc\MSSQL\sqljdbc_2.0\enu\sqljdbc4.jar;
Here is the snippet from HibernateUtil
import org.hibernate.*;
import org.hibernate.cfg.*;
public class HibernateUtil {
private static SessionFactory sessionFactory;
static {
try {
sessionFactory = new Configuration()
.configure("hibernate.cfg.xml")
.buildSessionFactory();
}
catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
System.err.println("Initial SessionFactory creation failed. " + ex);
throw new ExceptionInInitializerError(ex);
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 2 months