-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Transaction Fails, can't exit gracefully
PostPosted: Wed Jan 28, 2009 5:18 pm 
Newbie

Joined: Thu Aug 23, 2007 9:52 pm
Posts: 9
This is a simple code and my insert fails due to not null but my program crashes. Even though insert call is in try catch block

At end of transaction ,it tries to commit transaction and my program crashes.

Is there any way, I can stop my program from crashing :-(

Any help is appreciated.


Service class

Code:
public class HibServiceImpl implements HibService{
   
   @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW)
   public void insertTeacher(AnnotatedTeacher tea) {
      
      
       try {
            AnnotatedTeacher t1 = new AnnotatedTeacher();
            t1.setId(1);
            tdao.insertTeacher(t1);
         } catch (Exception e) {
            System.out.println("caught exception 1 " );
         }
      
   }

}


DAO class

Code:
public class AnnotatedTeacherDAOImpl extends HibernateDaoSupport implements AnnotatedTeacherDAO{

   


   public void insertTeacher(AnnotatedTeacher tea) {
      
      getHibernateTemplate().save(tea);
      
   }
}


Bean code

Code:
@Entity
@Table(name="Teacher")
public class AnnotatedTeacher {

   @Id
   @Column(name = "id")
   private Integer id;
   
   @Column(name = "name")
    private String name; 
   
   public Integer getId() {
      return id;
   }
   public void setId(Integer id) {
      this.id = id;
   }
   public String getName() {
      return name;
   }
   public void setName(String name) {
      this.name = name;
   }   
}


ApplicationContext

Code:
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
      <property name="dataSource" ref="dataSource"/>
      
      <property name="annotatedClasses">
         <list>
            <value>com.AnnotatedTeacher</value>
         </list>
      </property>

      <property name="hibernateProperties">
         <props>
         <prop key="hibernate.dialect">org.hibernate.dialect.FirebirdDialect</prop>
         <prop key="hibernate.jdbc.use_get_generated_keys">true</prop>
         <prop key="hibernate.show_sql">true</prop>
         </props>
      </property>
   </bean>



   <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="org.firebirdsql.jdbc.FBDriver"/>
      <property name="url"             value="jdbc:firebirdsql:localhost/3050:c:/FirebirdDB/Collector.FDB"/>
      <property name="username"        value="SYSDBA"/>
      <property name="password"        value="masterkey"/>
    </bean>


   <tx:annotation-driven transaction-manager="txManager" />

    <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>




Exception Log is

[code]2009-01-28 13:09:30,798 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - Session factory constructed with filter configurations : {}
2009-01-28 13:09:30,798 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - instantiating session factory with properties: {java.vendor=Sun Microsystems Inc., localRepository=c:/maven/repository, env.DEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\DesktopProtection, sun.java.launcher=SUN_STANDARD, sun.management.compiler=HotSpot Client Compiler, env.PROMPT=$P$G, hibernate.jdbc.use_get_generated_keys=true, os.name=Windows XP, env.FP_NO_HOST_CHECK=NO, sun.boot.class.path=C:\Dev\JavaJDK\jdk1.6.0_11\jre\lib\resources.jar;C:\Dev\JavaJDK\jdk1.6.0_11\jre\lib\rt.jar;C:\Dev\JavaJDK\jdk1.6.0_11\jre\lib\sunrsasign.jar;C:\Dev\JavaJDK\jdk1.6.0_11\jre\lib\jsse.jar;C:\Dev\JavaJDK\jdk1.6.0_11\jre\lib\jce.jar;C:\Dev\JavaJDK\jdk1.6.0_11\jre\lib\charsets.jar;C:\Dev\JavaJDK\jdk1.6.0_11\jre\classes, env.COMPUTERNAME=MNOMAN-WINXPX, env.ALLUSERSPROFILE=C:\Documents and Settings\All Users, hibernate.current_session_context_class=org.springframework.orm.hibernate3.SpringSessionContext, sun.desktop=windows, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.6.0_11-b03, env.HOMEPATH=\Documents and Settings\mnoman, env.HOMESHARE=\\pa-home.eng.company.com\home4, user.name=mnoman, env.QTJAVA=C:\Program Files\Java\j2re1.4.2_06\lib\ext\QTJava.zip, user.language=en, sun.boot.library.path=C:\Dev\JavaJDK\jdk1.6.0_11\jre\bin, classworlds.conf=C:\Dev\maven-2.0.9\bin\..\bin\m2.conf, java.version=1.6.0_11, env.PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 11, GenuineIntel, user.timezone=America/Los_Angeles, env.TEMP=C:\DOCUME~1\mnoman\LOCALS~1\Temp, sun.arch.data.model=32, java.endorsed.dirs=C:\Dev\JavaJDK\jdk1.6.0_11\jre\lib\endorsed, env.VSEDEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\DesktopProtection, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86, env.HOMEDRIVE=C:, sun.jnu.encoding=Cp1252, file.encoding.pkg=sun.io, file.separator=\, java.specification.name=Java Platform API Specification, java.class.version=50.0, user.country=US, java.home=C:\Dev\JavaJDK\jdk1.6.0_11\jre, env.APPDATA=C:\Documents and Settings\mnoman\Application Data, java.vm.info=mixed mode, sharing, env.ComSpec=C:\WINDOWS\system32\cmd.exe, env.OS=Windows_NT, env.CommonProgramFiles=C:\Program Files\Common Files, os.version=5.1, hibernate.transaction.factory_class=org.springframework.orm.hibernate3.SpringTransactionFactory, path.separator=;, java.vm.version=11.0-b16, user.variant=, env.USERPROFILE=C:\Documents and Settings\mnoman, env.JAVA_HOME=C:\Dev\JavaJDK\jdk1.6.0_11, java.awt.printerjob=sun.awt.windows.WPrinterJob, env.TMP=C:\DOCUME~1\mnoman\LOCALS~1\Temp, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, user.home=C:\Documents and Settings\mnoman, env.SESSIONNAME=Console, java.specification.vendor=Sun Microsystems Inc., env.CLASSPATH=.;C:\Program Files\Java\j2re1.4.2_06\lib\ext\QTJava.zip, env.M2_HOME=C:\Dev\maven-2.0.9\bin\.., env.VS80COMNTOOLS=C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\, env.NUMBER_OF_PROCESSORS=4, java.library.path=C:\Dev\JavaJDK\jdk1.6.0_11\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Perforce\;C:\Dev\maven-2.0.9\bin;C:\Dev\ant-1.7.1;C:\Dev\JavaJDK\jdk1.6.0_11\bin, java.vendor.url=http://java.sun.com/, env.USERDNSDOMAIN=company.COM, env.MAVEN_CMD_LINE_ARGS=clean install, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.FirebirdDialect, maven.home=C:\Dev\maven-2.0.9\bin\.., java.runtime.name=Java(TM) SE Runtime Environment, java.class.path=C:\Dev\maven-2.0.9\bin\..\boot\classworlds-1.1.jar, hibernate.bytecode.use_reflection_optimizer=false, env.MAVEN_JAVA_EXE="C:\Dev\JavaJDK\jdk1.6.0_11\bin\java.exe", java.vm.specification.name=Java Virtual Machine Specification, env.LOGONSERVER=\\PAROOTDC04, env.windir=C:\WINDOWS, java.vm.specification.version=1.0, env.PROCESSOR_ARCHITECTURE=x86, sun.os.patch.level=Service Pack 3, sun.cpu.endian=little, env.HOME=C:\Documents and Settings\mnoman, hibernate.connection.provider_class=org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider, env.ProgramFiles=C:\Program Files, env.ANT_HOME=C:\Dev\ant-1.7.1, surefire.test.class.path=C:\ncp\shared\main\component\JCollector\component\scheduler\target\test-classes;C:\ncp\shared\main\component\JCollector\component\scheduler\target\classes;c:\maven\repository\com\company\jcollector\model\1.0-SNAPSHOT\model-1.0-SNAPSHOT.jar;c:\maven\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;c:\maven\repository\org\apache\geronimo\specs\geronimo-activation_1.1_spec\1.0.2\geronimo-activation_1.1_spec-1.0.2.jar;c:\maven\repository\org\apache\geronimo\specs\geronimo-annotation_1.0_spec\1.1.1\geronimo-annotation_1.0_spec-1.1.1.jar;c:\maven\repository\org\apache\geronimo\specs\geronimo-javamail_1.4_spec\1.3\geronimo-javamail_1.4_spec-1.3.jar;c:\maven\repository\org\apache\geronimo\specs\geronimo-servlet_2.5_spec\1.2\geronimo-servlet_2.5_spec-1.2.jar;c:\maven\repository\org\apache\geronimo\specs\geronimo-ws-metadata_2.0_spec\1.1.2\geronimo-ws-metadata_2.0_spec-1.1.2.jar;c:\maven\repository\jetty\jetty\6.1.9\jetty-6.1.9.jar;c:\maven\repository\jetty\jetty-util\6.1.9\jetty-util-6.1.9.jar;c:\maven\repository\junit\junit\4.4\junit-4.4.jar;c:\maven\repository\junit\junit-dep\4.4\junit-dep-4.4.jar;c:\maven\repository\org\hamcrest\hamcrest-core\1.1\hamcrest-core-1.1.jar;c:\maven\repository\xml-resolver\xml-resolver\1.2\xml-resolver-1.2.jar;c:\maven\repository\org\apache\neethi\neethi\2.0.4\neethi-2.0.4.jar;c:\maven\repository\wsdl4j\wsdl4j\1.6.1\wsdl4j-1.6.1.jar;c:\maven\repository\org\apache\xmlbeans\xmlbeans\2.3.0\xmlbeans-2.3.0.jar;c:\maven\repository\org\apache\ws\commons\schema\XmlSchema\1.4.2\XmlSchema-1.4.2.jar;c:\maven\repository\javax\xml\jaxb-api\2.1\jaxb-api-2.1.jar;c:\maven\repository\javax\xml\jaxb-impl\2.1.6\jaxb-impl-2.1.6.jar;c:\maven\repository\javax\xml\saaj-api\1.3\saaj-api-1.3.jar;c:\maven\repository\javax\xml\soap\saaj-impl\1.3\saaj-impl-1.3.jar;c:\maven\repository\javax\xml\ws\jaxws-api\2.1-1\jaxws-api-2.1-1.jar;c:\maven\repository\javax\xml\bind\jaxb-api\2.1\jaxb-api-2.1.jar;c:\maven\repository\javax\xml\stream\stax-api\1.0-2\stax-api-1.0-2.jar;c:\maven\repository\javax\activation\activation\1.1\activation-1.1.jar;c:\maven\repository\javax\xml\soap\saaj-api\1.3\saaj-api-1.3.jar;c:\maven\repository\activation\activation\1.0.2\activation-1.0.2.jar;c:\maven\repository\javax\annotation\jsr250-api\1.0\jsr250-api-1.0.jar;c:\maven\repository\javax\jws\jsr181\1.0\jsr181-1.0.jar;c:\maven\repository\net\java\dev\stax-utils\stax-utils\20060502\stax-utils-20060502.jar;c:\maven\repository\org\apache\geronimo\plugins\cxf\2.1.1\cxf-2.1.1.jar;c:\maven\repository\log4j\log4j\1.2.13\log4j-1.2.13.jar;c:\maven\repository\org\springframework\spring-core\2.5.6\spring-core-2.5.6.jar;c:\maven\repository\org\springframework\spring-beans\2.5.6\spring-beans-2.5.6.jar;c:\maven\repository\org\springframework\spring-context\2.5.6\spring-context-2.5.6.jar;c:\maven\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;c:\maven\repository\org\springframework\spring-web\2.5.6\spring-web-2.5.6.jar;c:\maven\repository\com\sun\xml\fastinfoset\FastInfoset\1.2.3\FastInfoset-1.2.3.jar;c:\maven\repository\org\springframework\spring-aspects\2.0-m2\spring-aspects-2.0-m2.jar;c:\maven\repository\aspectj\aspectjrt\1.5.3\aspectjrt-1.5.3.jar;c:\maven\repository\aspectj\aspectjweaver\1.5.3\aspectjweaver-1.5.3.jar;c:\maven\repository\tanukisoft\wrapper\3.2.0\wrapper-3.2.0.jar;c:\maven\repository\firebird\jaybird-full\2.1.6\jaybird-full-2.1.6.jar;c:\maven\repository\com\ibatis\ibatis\2.3.4\ibatis-2.3.4.jar;c:\maven\repository\org\springframework\spring-test\2.5.6\spring-test-2.5.6.jar;c:\maven\repository\commons-dbcp\commons-dbcp\1.2.2\commons-dbcp-1.2.2.jar;c:\maven\repository\commons-pool\commons-pool\1.3\commons-pool-1.3.jar;c:\maven\repository\org\springframework\spring-orm\2.5.6\spring-orm-2.5.6.jar;c:\maven\repository\org\springframework\spring-tx\2.5.6\spring-tx-2.5.6.jar;c:\maven\repository\org\springframework\spring-dao\2.0-m4\spring-dao-2.0-m4.jar;c:\maven\repository\javax\transaction\jta\1.0.1B\jta-1.0.1B.jar;c:\maven\repository\org\springframework\spring-jdbc\2.5.6\spring-jdbc-2.5.6.jar;c:\maven\repository\quartz\quartz\1.5.2\quartz-1.5.2.jar;c:\maven\repository\org\hibernate\hibernate\3.2.1.ga\hibernate-3.2.1.ga.jar;c:\maven\repository\net\sf\ehcache\ehcache\1.2.3\ehcache-1.2.3.jar;c:\maven\repository\commons-collections\commons-collections\2.1.1\commons-collections-2.1.1.jar;c:\maven\repository\asm\asm-attrs\1.5.3\asm-attrs-1.5.3.jar;c:\maven\repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar;c:\maven\repository\antlr\antlr\2.7.6\antlr-2.7.6.jar;c:\maven\repository\cglib\cglib\2.1_3\cglib-2.1_3.jar;c:\maven\repository\asm\asm\1.5.3\asm-1.5.3.jar;c:\maven\repository\org\hibernate\hibernate-annotations\3.2.0.ga\hibernate-annotations-3.2.0.ga.jar;c:\maven\repository\javax\persistence\persistence-api\1.0\persistence-api-1.0.jar;c:\maven\repository\org\springframework\spring-aop\2.5.6\spring-aop-2.5.6.jar;c:\maven\repository\org\springframework\spring-mock\2.0.2\spring-mock-2.0.2.jar;, java.io.tmpdir=C:\DOCUME~1\mnoman\LOCALS~1\Temp\, env.PROCESSOR_REVISION=0f0b, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, env.MAVEN_OPTS=-Xmx512m, env.SystemRoot=C:\WINDOWS, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, os.arch=x86, java.ext.dirs=C:\Dev\JavaJDK\jdk1.6.0_11\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext, user.dir=C:\ncp\shared\main\component\JCollector\component\scheduler, line.separator=
, java.vm.name=Java HotSpot(TM) Client VM, env.P4CONFIG=.p4config, env.CLASSWORLDS_JAR="C:\Dev\maven-2.0.9\bin\..\boot\classworlds-1.1.jar", env.PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH, env.Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Perforce\;C:\Dev\maven-2.0.9\bin;C:\Dev\ant-1.7.1;C:\Dev\JavaJDK\jdk1.6.0_11\bin, basedir=C:\ncp\shared\main\component\JCollector\component\scheduler, env.ERROR_CODE=0, env.USERNAME=mnoman, env.SystemDrive=C:, file.encoding=Cp1252, env.USERDOMAIN=companyM, java.specification.version=1.6, env.PROCESSOR_LEVEL=6, hibernate.show_sql=true}
2009-01-28 13:09:30,986 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Static SQL for entity: com.company.jcollector.scheduler.beans.AnnotatedTeacher
2009-01-28 13:09:30,986 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Version select: select id from Teacher where id =?
2009-01-28 13:09:30,986 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Snapshot select: select annotatedt_.id, annotatedt_.name as name0_ from Teacher annotatedt_ where annotatedt_.id=?
2009-01-28 13:09:30,986 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Insert 0: insert into Teacher (name, id) values (?, ?)
2009-01-28 13:09:30,986 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Update 0: update Teacher set name=? where id=?
2009-01-28 13:09:30,986 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Delete 0: delete from Teacher where id=?
2009-01-28 13:09:31,001 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity com.company.jcollector.scheduler.beans.AnnotatedTeacher: select annotatedt0_.id as id0_0_, annotatedt0_.name as name0_0_ from Teacher annotatedt0_ where annotatedt0_.id=?
2009-01-28 13:09:31,001 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity com.company.jcollector.scheduler.beans.AnnotatedTeacher: select annotatedt0_.id as id0_0_, annotatedt0_.name as name0_0_ from Teacher annotatedt0_ where annotatedt0_.id=?
2009-01-28 13:09:31,001 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity com.company.jcollector.scheduler.beans.AnnotatedTeacher: select annotatedt0_.id as id0_0_, annotatedt0_.name as name0_0_ from Teacher annotatedt0_ where annotatedt0_.id=? with lock
2009-01-28 13:09:31,001 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity com.company.jcollector.scheduler.beans.AnnotatedTeacher: select annotatedt0_.id as id0_0_, annotatedt0_.name as name0_0_ from Teacher annotatedt0_ where annotatedt0_.id=? with lock
2009-01-28 13:09:31,001 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity com.company.jcollector.scheduler.beans.AnnotatedTeacher: select annotatedt0_.id as id0_0_, annotatedt0_.name as name0_0_ from Teacher annotatedt0_ where annotatedt0_.id=? with lock
2009-01-28 13:09:31,017 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_MERGE on entity com.company.jcollector.scheduler.beans.AnnotatedTeacher: select annotatedt0_.id as id0_0_, annotatedt0_.name as name0_0_ from Teacher annotatedt0_ where annotatedt0_.id=?
2009-01-28 13:09:31,017 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_REFRESH on entity com.company.jcollector.scheduler.beans.AnnotatedTeacher: select annotatedt0_.id as id0_0_, annotatedt0_.name as name0_0_ from Teacher annotatedt0_ where annotatedt0_.id=?
2009-01-28 13:09:31,017 [main] DEBUG org.hibernate.impl.SessionFactoryObjectFactory - initializing class SessionFactoryObjectFactory
2009-01-28 13:09:31,017 [main] DEBUG org.hibernate.impl.SessionFactoryObjectFactory - registered: 8a9404a91f1f1346011f1f1347090000 (unnamed)
2009-01-28 13:09:31,017 [main] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
2009-01-28 13:09:31,017 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - instantiated session factory
2009-01-28 13:09:31,017 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - Checking 0 named HQL queries
2009-01-28 13:09:31,017 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - Checking 0 named SQL queries
2009-01-28 13:09:31,017 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
2009-01-28 13:09:31,017 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'sessionFactory'
2009-01-28 13:09:31,017 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
2009-01-28 13:09:31,032 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'tdao'
2009-01-28 13:09:31,032 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
2009-01-28 13:09:31,032 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'tdao'
2009-01-28 13:09:31,032 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
2009-01-28 13:09:31,032 [main] DEBUG org.springframework.transaction.annotation.AnnotationTransactionAttributeSource - Adding transactional method [getTeacher] with attribute [PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT]
2009-01-28 13:09:31,048 [main] DEBUG org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator - Creating implicit proxy for bean 'hibService' with 0 common interceptors and 1 specific interceptors
2009-01-28 13:09:31,048 [main] DEBUG org.springframework.aop.framework.JdkDynamicAopProxy - Creating JDK dynamic proxy: target source is SingletonTargetSource for target object [com.company.jcollector.scheduler.service.HibServiceImpl@1f08ed8]
2009-01-28 13:09:31,048 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'hibService'
2009-01-28 13:09:31,048 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'tdao'
2009-01-28 13:09:31,048 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'sessionFactory'
2009-01-28 13:09:31,048 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'dataSource'
2009-01-28 13:09:31,048 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.config.internalAutoProxyCreator'
2009-01-28 13:09:31,048 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0'
2009-01-28 13:09:31,048 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.transaction.interceptor.TransactionInterceptor#0'
2009-01-28 13:09:31,048 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.transaction.interceptor.TransactionInterceptor#0'
2009-01-28 13:09:31,048 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.transaction.interceptor.TransactionInterceptor#0' to allow for resolving potential circular references
2009-01-28 13:09:31,048 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'txManager'
2009-01-28 13:09:31,048 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'txManager'
2009-01-28 13:09:31,064 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'txManager' to allow for resolving potential circular references
2009-01-28 13:09:31,064 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'sessionFactory'
2009-01-28 13:09:31,064 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'txManager'
2009-01-28 13:09:31,079 [main] INFO org.springframework.orm.hibernate3.HibernateTransactionManager - Using DataSource [org.apache.commons.dbcp.BasicDataSource@9903f4] of Hibernate SessionFactory for HibernateTransactionManager
2009-01-28 13:09:31,079 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
2009-01-28 13:09:31,079 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'txManager'
2009-01-28 13:09:31,079 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0'
2009-01-28 13:09:31,079 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'org.springframework.transaction.interceptor.TransactionInterceptor#0'
2009-01-28 13:09:31,079 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.transaction.interceptor.TransactionInterceptor#0'
2009-01-28 13:09:31,079 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
2009-01-28 13:09:31,079 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'txManager'
2009-01-28 13:09:31,079 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'hibService'
2009-01-28 13:09:31,079 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Autowiring by type from bean name 'com.company.jcollector.HibAppTest' via property 'hibService' to bean named 'hibService'
2009-01-28 13:09:31,095 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'hibService'
2009-01-28 13:09:31,095 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Autowiring by type from bean name 'com.company.jcollector.HibAppTest' via property 'hibService' to bean named 'hibService'
2009-01-28 13:09:31,095 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.interceptor.TransactionInterceptor#0'
2009-01-28 13:09:31,095 [main] DEBUG org.springframework.transaction.annotation.AnnotationTransactionAttributeSource - Adding transactional method [insertTeacher] with attribute [PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT]
2009-01-28 13:09:31,095 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Creating new transaction with name [com.company.jcollector.scheduler.service.HibService.insertTeacher]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT
2009-01-28 13:09:31,126 [main] DEBUG org.hibernate.impl.SessionImpl - opened session at timestamp: 12331769710
2009-01-28 13:09:31,126 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Opened new Session [org.hibernate.impl.SessionImpl@d5c0f9] for Hibernate transaction
2009-01-28 13:09:31,126 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@d5c0f9]
2009-01-28 13:09:31,142 [main] DEBUG org.hibernate.transaction.JDBCTransaction - begin
2009-01-28 13:09:31,142 [main] DEBUG org.hibernate.jdbc.ConnectionManager - opening JDBC connection
2009-01-28 13:09:31,142 [main] DEBUG org.hibernate.transaction.JDBCTransaction - current autocommit status: true
2009-01-28 13:09:31,142 [main] DEBUG org.hibernate.transaction.JDBCTransaction - disabling autocommit
2009-01-28 13:09:31,142 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [jdbc:firebirdsql:java:localhost/3050:c:/FirebirdDB/Collector.FDB, UserName=SYSDBA, Jaybird JCA/JDBC driver]
2009-01-28 13:09:31,142 [main] DEBUG org.springframework.orm.hibernate3.HibernateTemplate - Found thread-bound Session for HibernateTemplate
2009-01-28 13:09:31,142 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener - generated identifier: 1, using strategy: org.hibernate.id.Assigned
2009-01-28 13:09:31,157 [main] DEBUG org.springframework.orm.hibernate3.HibernateTemplate - Not closing pre-bound Hibernate Session after HibernateTemplate
2009-01-28 13:09:31,157 [main] DEBUG com.company.jcollector.scheduler.daoimpl.AnnotatedTeacherDAOImpl - **************************************************************
2009-01-28 13:09:31,157 [main] DEBUG com.company.jcollector.scheduler.daoimpl.AnnotatedTeacherDAOImpl - **************************************************************
2009-01-28 13:09:31,157 [main] DEBUG com.company.jcollector.scheduler.daoimpl.AnnotatedTeacherDAOImpl - **************************************************************
2009-01-28 13:09:31,157 [main] DEBUG com.company.jcollector.scheduler.service.HibServiceImpl - $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
2009-01-28 13:09:31,157 [main] DEBUG com.company.jcollector.scheduler.service.HibServiceImpl - $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
2009-01-28 13:09:31,157 [main] DEBUG com.company.jcollector.scheduler.service.HibServiceImpl - $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
2009-01-28 13:09:31,157 [main] DEBUG com.company.jcollector.scheduler.service.HibServiceImpl - $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
2009-01-28 13:09:31,157 [main] DEBUG com.company.jcollector.scheduler.service.HibServiceImpl - $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
2009-01-28 13:09:31,157 [main] DEBUG com.company.jcollector.scheduler.service.HibServiceImpl - $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
2009-01-28 13:09:31,157 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Initiating transaction commit
2009-01-28 13:09:31,157 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@d5c0f9]
2009-01-28 13:09:31,157 [main] DEBUG org.hibernate.transaction.JDBCTransaction - commit
2009-01-28 13:09:31,157 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades
2009-01-28 13:09:31,157 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - dirty checking collections
2009-01-28 13:09:31,157 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
2009-01-28 13:09:31,157 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2009-01-28 13:09:31,157 [main] DEBUG org.hibernate.pretty.Printer - listing entities:
2009-01-28 13:09:31,157 [main] DEBUG org.hibernate.pretty.Printer - com.company.jcollector.scheduler.beans.AnnotatedTeacher{id=1, name=null}
2009-01-28 13:09:31,157 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2009-01-28 13:09:31,157 [main] DEBUG org.hibernate.SQL - insert into Teacher (name, id) values (?, ?)
2009-01-28 13:09:31,236 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2009-01-28 13:09:31,236 [main] DEBUG org.hibernate.util.JDBCExceptionReporter - could not insert: [com.company.jcollector.scheduler.beans.AnnotatedTeacher] [insert into Teacher (name, id) values (?, ?)]
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544347. validation error for column NAME, value "*** null ***"
at org.firebirdsql.jdbc.AbstractPreparedStatement.internalExecute(AbstractPreparedStatement.java:730)
at org.firebirdsql.jdbc.AbstractPreparedStatement.executeUpdate(AbstractPreparedStatement.java:190)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2197)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2610)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:52)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy9.insertTeacher(Unknown Source)
at com.company.jcollector.HibAppTest.testSaveTeacher(HibAppTest.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
at
org.firebirdsql.gds.GDSException: validation error for column NAME, value "*** null ***"
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(AbstractJavaGDSImpl.java:2169)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(AbstractJavaGDSImpl.java:2119)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscDsqlExecute2(AbstractJavaGDSImpl.java:1185)
at org.firebirdsql.gds.impl.GDSHelper.executeStatement(GDSHelper.java:226)
at org.firebirdsql.jdbc.AbstractPreparedStatement.internalExecute(AbstractPreparedStatement.java:726)
at org.firebirdsql.jdbc.AbstractPreparedStatement.executeUpdate(AbstractPreparedStatement.java:190)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2197)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2610)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:52)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy9.insertTeacher(Unknown Source)
at com.company.jcollector.HibAppTest.testSaveTeacher(HibAppTest.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
2009-01-28 13:09:31,298 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 335544347, SQLState: HY000
2009-01-28 13:09:31,298 [main] ERROR org.hibernate.util.JDBCExceptionReporter - GDS Exception. 335544347. validation error for column NAME, value "*** null ***"
2009-01-28 13:09:31,298 [main] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not insert: [com.company.jcollector.scheduler.beans.AnnotatedTeacher]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2217)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2610)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:52)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy9.insertTeacher(Unknown Source)
at com.company.jcollector.HibAppTest.testSaveTeacher(HibAppTest.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544347. validation error for column NAME, value "*** null ***"
at org.firebirdsql.jdbc.AbstractPreparedStatement.internalExecute(AbstractPreparedStatement.java:730)
at org.firebirdsql.jdbc.AbstractPreparedStatement.executeUpdate(AbstractPreparedStatement.java:190)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2197)
... 43 more
2009-01-28 13:09:31,298 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
2009-01-28 13:09:31,298 [main] DEBUG org.springframework.beans.factory.xml.DefaultDocumentLoader - Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]
2009-01-28 13:09:31,314 [main] DEBUG org.springframework.beans.factory.xml.BeansDtdResolver - Found beans DTD [http://www.springframework.org/dtd/spring-beans-2.0.dtd] in classpath: spring-beans-2.0.dtd
2009-01-28 13:09:31,314 [main] DEBUG org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader - Loading bean definitions
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'DB2'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'DB2'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'DB2' to allow for resolving potential circular references
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'DB2'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'Derby'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'Derby'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'Derby' to allow for resolving potential circular references
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'Derby'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'H2'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'H2'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'H2' to allow for resolving potential circular references
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'H2'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'HSQL'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'HSQL'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'HSQL' to allow for resolving potential circular references
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'HSQL'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'Informix'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'Informix'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'Informix' to allow for resolving potential circular references
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'Informix'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'MS-SQL'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'MS-SQL'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'MS-SQL' to allow for resolving potential circular references
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'MS-SQL'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'MySQL'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'MySQL'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'MySQL' to allow for resolving potential circular references
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'MySQL'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'Oracle'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'Oracle'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'Oracle' to allow for resolving potential circular references
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'Oracle'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'PostgreSQL'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'PostgreSQL'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'PostgreSQL' to allow for resolving potential circular references
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'PostgreSQL'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'Sybase'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'Sybase'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'Sybase' to allow for resolving potential circular references
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'Sybase'
2009-01-28 13:09:31,329 [main] INFO org.springframework.jdbc.support.SQLErrorCodesFactory - SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.jdbc.support.SQLErrorCodesFactory - Looking up default SQLErrorCodes for DataSource [org.apache.commons.dbcp.BasicDataSource@9903f4]
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.jdbc.support.SQLErrorCodesFactory - Database product name cached for DataSource [org.apache.commons.dbcp.BasicDataSource@9903f4]: name is 'Firebird 2.14WI-V2.1.1.17910 Firebird 2.1/tcp (mnoman-winxpx)/P10'
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.jdbc.support.SQLErrorCodesFactory - SQL error codes for 'Firebird 2.14WI-V2.1.1.17910 Firebird 2.1/tcp (mnoman-winxpx)/P10' not found
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator - Unable to translate SQLException with Error code '335544347', will now try the fallback translator
2009-01-28 13:09:31,329 [main] DEBUG org.springframework.jdbc.support.SQLStateSQLExceptionTranslator - Extracted SQL state class 'HY' from value 'HY000'
2009-01-28 13:09:31,345 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Initiating transaction rollback after commit exception
org.springframework.jdbc.UncategorizedSQLException: Hibernate flushing: could not insert: [com.company.jcollector.scheduler.beans.AnnotatedTeacher]; uncategorized SQLException for SQL [insert into Teacher (name, id) values (?, ?)]; SQL state [HY000]; error code [335544347]; GDS Exception. 335544347. validation error for column NAME, value "*** null ***"; nested exception is org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544347. validation error for column NAME, value "*** null ***"
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.orm.hibernate3.HibernateTransactionManager.convertJdbcAccessException(HibernateTransactionManager.java:801)
at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:787)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:663)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy9.insertTeacher(Unknown Source)
at com.company.jcollector.HibAppTest.testSaveTeacher(HibAppTest.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544347. validation error for column NAME, value "*** null ***"
at org.firebirdsql.jdbc.AbstractPreparedStatement.internalExecute(AbstractPreparedStatement.java:730)
at org.firebirdsql.jdbc.AbstractPreparedStatement.executeUpdate(AbstractPreparedStatement.java:190)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2197)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2610)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:52)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655)
... 32 more
2009-01-28 13:09:31,345 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Rolling back Hibernate transaction on Session [org.hibernate.impl.SessionImpl@d5c0f9]
2009-01-28 13:09:31,345 [main] DEBUG org.hibernate.transaction.JDBCTransaction - rollback
2009-01-28 13:09:31,345 [main] DEBUG org.hibernate.transaction.JDBCTransaction - re-enabling autocommit
2009-01-28 13:09:31,345 [main] DEBUG org.hibernate.transaction.JDBCTransaction - rolled back JDBC Connection
2009-01-28 13:09:31,345 [main&


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2009 5:47 pm 
Regular
Regular

Joined: Tue Dec 30, 2008 8:14 pm
Posts: 50
Check the flush setting, and where you are flushing the session. Try to catch the exception here.

---
please rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2009 6:39 pm 
Newbie

Joined: Thu Aug 23, 2007 9:52 pm
Posts: 9
I am using default flush mode and if I flush out session explicitly in dao layer and put the try catch block around flush() in DAO layer then how would I pass it back to service layer then some thing has gone wrong in dao layer. Even if I throw some custom exception from dao to service layer then still at end of function of service, it tries to commit transaction and crashes program.

There must be some way to stop program from crashing in case transaction fails.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 6:14 pm 
Regular
Regular

Joined: Tue Dec 30, 2008 8:14 pm
Posts: 50
Application is throwing an exception. If you don't catch it, it will exit.

Couple of things to consider:
If the database operation fails, should the application ignore this and continue with the rest of the tasks? If so, DAO may catch and ignore the exception.

If the failure of the database operation is critical, I would catch the exception and process it - may be notify the user. May be the service layer needs to ignore the custom_database_operation exception.

---
please rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.