-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate/JTA transaction in Spring having problem.
PostPosted: Thu Apr 24, 2008 2:28 pm 
Newbie

Joined: Mon Mar 17, 2008 2:09 pm
Posts: 8
Hi All,

I'm having below code in applicationContext.xml(spring) file.

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

<bean id="eventManagerService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager"><ref local="transactionManager"/></property>
<property name="target"><ref local="eventManagerDAOTarget"/></property>
<property name="transactionAttributes">
<props>
<prop key="save">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>

In this configuration, when I try to access 'save' method I'm getting below error message. If I comment <prop key="save">PROPAGATION_REQUIRED</prop> this line then it is working fine.

14:16:21,760 WARN JDBCExceptionReporter:77 - SQL Error: 0, SQLState: HY000
14:16:21,760 ERROR JDBCExceptionReporter:78 - [BEA][Sybase JDBC Driver]No rows affected.
<Apr 24, 2008 2:16:22 PM EDT> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@1e2d16b - appName: '_appsdir_spring_war', name: 'spring.war', context-path: '/spring'] Root cause of ServletException.
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not insert: [events.EventManager]; uncategorized SQLException for SQL [insert into EVENTS (EVENT_DATE, title, TEST_DATE)
values (?, ?, ?)]; SQL state [HY000]; error code [0]; [BEA][Sybase JDBC Driver]No rows affected.; nested exception is java.sql.SQLException: [BEA][Sybase JDBC Driver]No rows affected.
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:124)
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322)
at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:379)
Truncated. see log file for complete stacktrace
java.sql.SQLException: [BEA][Sybase JDBC Driver]No rows affected.
at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
at weblogic.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
at weblogic.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:128)
Truncated. see log file for complete stacktrace


I even tried with Jta transation still I'm getting same error.

Thanks in advance.

Regards,
Sharath.


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

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.