Hibernate TransactionException: Transaction not successfully started

November 13, 2010

0

If you got this cryptic error … among other issues … this could because you had one transaction embedded inside another. MethodA(){ …. objectDAO.getSession().beginTransaction(); objectDAO.save(objectInstance); MethodB(); objectDAO.getSession().getTransaction().commit() …. } MethodB(){ …. anotherObjectDAO.getSession().beginTransaction();//<===Begining a transaction inside another transaction … REMOVE THIS anotherObjectDAO.save(anotherObjectInstance); anotherObjectDAO.getSession().getTransaction().commit()//<===Begining a transaction inside another transaction … REMOVE THIS …. } You may have […]

Posted in: Hibernate

Struts Datetimepicker control not working

October 21, 2010

1

Struts Datetimepicker doesn’t work. PERIOD. It is bulky, slow, buggy and doesn’t work in Firefox. Just switch to jQueryUI Datepicker … it works like a breeze. Step 1 – Download and add the links to the jQuery templates and scripts <link type=”text/css” href=”./css/ui-lightness/jquery-ui-1.8.5.custom.css” rel=”stylesheet” /> <script type=”text/javascript” src=”./js/jquery-1.4.2.min.js”></script> <script type=”text/javascript” src=”./js/jquery-ui-1.8.5.custom.min.js”></script> Step 2 – Add […]

Posted in: jQuery, Struts2

Unknown Faceted Project Problem (Java Version Mismatch)

September 25, 2010

1

If you upgraded or downgraded the Java Compiler version in Eclipse … you may see Unknown Faceted Project Problem (Java Version Mismatch) You need to take a look at Project Properties > Project Facets … and this must match the Java compiler compliance level. Refer to this link for more details ….

Posted in: Eclipse IDE

Hibernate mySQL connection lost overnight

September 19, 2010

0

Using tomcat + mySQL + Hibernate … Your application works fine … then you wake up in the morning and try to use it … it crashes. You restart Tomcat … it works fine again. There are a lot of posts on the internet about this 8 hour problem To fix it … 1. Change […]

Posted in: Hibernate

ClassNotFoundException –>FilterDispatcher Struts2 in Eclipse

September 15, 2010

0

If you are getting started with Struts2 or trying to migrate from MyEclipse to Eclipse … you may encounter ClassNotFoundException –>FilterDispatcher error even after adding all the jars. Check these 1. Project Build path … Add External Jars … make sure you add struts2-core-2.0.14.jar commons-logging-1.0.4.jar freemarker-2.3.8.jar ognl-2.6.11.jar xwork-2.0.7.jar 2. Add taglibs standard jars (Download from […]

Tagged: ,
Posted in: Struts2

Migrating Hibernate from 3.1 to 3.5.x (3.5.3 actually)

September 10, 2010

0

After changing the jar files (Hibernate3, all in \lib\required and any that you use from \lib\optional) Here’s the migration quide … #1.  I got a java.lang.Long class cast exception. On further investigation I found that any count(*) query returns Long (not sure what it was doing in 3.1) and I was casting it as Integer. Even […]

Posted in: Hibernate

Hibernate Exception – Could not synchronize database with session

July 24, 2010

0

One fine saturday morning, trying to do a new release. A list all action that always worked started throwing up exceptions in Hibernate. Could not synchronize database with session Duplicate entry ‘1’ for key 2 I wasn’t even inserting or updating … and yet this suddenly broke. I figured out after a few frustrating hours […]

Posted in: Hibernate