exception « Transaction « Spring Q&A





1. is there a way to force a transactional rollback without encountering an exception?    stackoverflow.com

I have a method that does a bunch of things; amongst them doing a number of inserts and updates. It's declared thusly...

@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false)
public int ...

2. Rollback on every checked exception, whenever I say @Transactional    stackoverflow.com

Since the programmer is forced to catch all checked exception, I to throw checked exception in case of any problem. I would like to rollback on any of those expections. Writing ...

3. Roll back transaction after exception in JPA + Spring    stackoverflow.com

I'm using Spring and JPA with HIbernate underneath. When a PersistenceException is thrown, I want to catch it and return the error message so that it is not propagated up to ...

4. Hibernate, Spring, @Transactional - surround with try/catch?    stackoverflow.com

Im working on developing a webapplication with Spring 3 and Hibernate 3.6. Ive got some questions to the @Transactional Annotation and the structure of the code. -> When I use @Transactional (transaction ...

5. No rollback only for transaction when exception occurs in submethod    stackoverflow.com

I'm using Hibernate + spring + @Transactional annotations to handle transactions in my application. Transaction manager is declared as follows:

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

<tx:annotation-driven transaction-manager="transactionManager"/>
This works well in ...

6. Can i use spring exception translation without using spring-managed-transaction?    stackoverflow.com

I'm developing with JPA 2 and Spring 3. I'm using the @Repository for my Dao classes hoping that i could make use of the Spring exception translation. But the problem is, i'm not ...

7. Aborting transaction created by @Transactional but returning properly (not throwing exception)    stackoverflow.com

I have a method annotated with @Transactional. In this method a data object is parsed and should finally be saved in the database. If the parsing fails, this method does not ...

8. Spring JPA provider produces wring exception on optimistic lock failure    stackoverflow.com

In case there is failure in optimistic locking I expect JPA entity manager to throw javax.persistence.OptimisticLockingException Yet when I use spring orm jpa it provides ObjectOptimisticLockingException which is not related with ...

9. Glassfish v3.0.1 / JTA / (JPA2/Hibernate3.5) / Spring 3 exception mapping.    forum.springsource.org

Jan 10th, 2011, 11:39 PM #1 AntonGolovin View Profile View Forum Posts Private Message Junior Member Join Date Jan 2011 Posts 6 Glassfish v3.0.1 / JTA / (JPA2/Hibernate3.5) / Spring 3 ...





10. Glassfish v3.0.1 / JTA / (JPA2/Hibernate3.5) / Spring 3 exception mapping.    forum.springsource.org

Jan 12th, 2011, 03:07 PM #1 AntonGolovin View Profile View Forum Posts Private Message Junior Member Join Date Jan 2011 Posts 6 Glassfish v3.0.1 / JTA / (JPA2/Hibernate3.5) / Spring 3 ...

11. Transaction is not rolling back in case of exception    forum.springsource.org

Transaction is not rolling back in case of exception I think transaction is not kicking in atall. I can provide other files if required. On console it inserts the data and ...

12. Adding rollback for exception at transaction manager level    forum.springsource.org

Hi, I use @Transaction annotation for all my transaction classes and methods. By default spring rollback for only runtimeException. i want these transactions to be rolled back for all exceptions including ...

13. Poller transactional functionality, checked exceptions and rollback rules    forum.springsource.org

Poller transactional functionality, checked exceptions and rollback rules Lets say I have two Pollable[Jms]Channels and a ServiceActivator between them with a transactional poller with atomikos JTA transaction management (xa because of ...

14. Rollback is not happening while exception    forum.springsource.org

Rollback is not happening while exception Hi Guyz, Can anyone please help me out with this? I have implemented transaction management with AOP in my project. But in case of exception ...

15. sftp:outbound-channel-adapter locks a file if exception occurs during writing    forum.springsource.org

Jun 8th, 2011, 09:46 AM #1 damjankumar View Profile View Forum Posts Private Message Junior Member Join Date Oct 2008 Posts 2 sftp:outbound-channel-adapter locks a file if exception occurs during writing ...

16. Help with no-rollback-exception-classes configuring    forum.springsource.org

Help with no-rollback-exception-classes configuring Hi all, my use case is a simple batch repeat. My job configuration:





17. Item processor rollbacks & starts over again if exception occurs in between    forum.springsource.org

Item processor rollbacks & starts over again if exception occurs in between Hi, We have been using spring batch framework for few months now. Yesterday we noticed that batch processing doesnt ...

18. No Duplicate entry exception on transactional test    forum.springsource.org

No Duplicate entry exception on transactional test Hi Everyone! I created a simple application for using EntityManager with spring transaction. I have a user table where usernames are unique. When I ...

19. Suppress exception propagation and "outer" transaction rollback    forum.springsource.org

Suppress exception propagation and "outer" transaction rollback Hi! I am having issues suppressing errors in my Gateway error flow. Instead of just rolling back the inner tx, I get "Transaction rolled ...

20. No rollback with exceptions using Hibernate    forum.springsource.org

No rollback with exceptions using Hibernate Hello! I'm new to using Spring/Hibernate, so I thank you in advance for your patience =) I'm trying to use Spring's transaction management with Hibernate, ...

21. Transaction propagation and exception rollback    forum.springsource.org

Transaction propagation and exception rollback Hi, Here is my problem: - I declare in my appCtx file serviceA with a method with transaction attribute "PROPAGATION_REQUIRED,-Exception" - I declare another service, serviceB ...

22. Transaction propagation and Exception    forum.springsource.org

Transaction propagation and Exception Hi, I use Spring+hibernate3. This is ApplicationContext snippet: PROPAGATION_REQUIRED PROPAGATION_REQUIRED

23. Advice on transaction exception handling    forum.springsource.org

I currently have my declarative transaction config setup to rollback on specified methods using java.lang.RuntimeException. For example: Code: PROPAGATION_REQUIRED,-java.lang.RuntimeException I did this because I figured I wanted to rollback, basically ...

24. exception with hibernate transaction    forum.springsource.org

exception with hibernate transaction Need some help urgently, trying to build a stable enviroment with spring 1.2.4 and hibernate3 and get the following error -> Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: ...

25. another exception with hibernate transaction    forum.springsource.org

another exception with hibernate transaction Running postgres 7.4.8 , tomcat 5.0.28 with spring.jar (v1.1) and hibernate 2 . Trying to configure a new application with transactional support . Error happends when ...

26. Another question about 'Transaction not rollbacked' on exception    forum.springsource.org

Dec 2nd, 2005, 04:20 AM #1 YSutarko View Profile View Forum Posts Private Message Member Join Date Aug 2004 Posts 34 Another question about 'Transaction not rollbacked' on exception hello.. i've ...

27. Transaction not throwing original exception    forum.springsource.org

Transaction not throwing original exception Here's my situation I have a service class that has a method Code: public Long[] createStuffs(StuffBean[] stuffBeans) throws MyException that I have declared transactional (via spring). ...

28. set rollback to exception class    forum.springsource.org

set rollback to exception class I have read the following tutorial but still dunt know how to configure the rollback to any exception class. The following complete example illustrates the use ...

29. JTA Hibernate exception - javax.transaction.RollbackException: null    forum.springsource.org

Jan 12th, 2006, 10:44 AM #1 Franky View Profile View Forum Posts Private Message Junior Member Join Date Jun 2005 Location Amersfoort, The Netherlands Posts 4 JTA Hibernate Websphere 4 - ...

30. Exception/tx-rollback in @Transactional invoked by @Transactional method?    forum.springsource.org

I have an class such that one @Transactional method invokes another @Transactional method. When the called method throws an exception the transaction is rolled back by the after throwing advice (which ...

31. jta transaction with hibernate exception during deployment on jes    forum.springsource.org

Jul 18th, 2006, 07:56 AM #1 jayenho View Profile View Forum Posts Private Message Junior Member Join Date Jul 2006 Posts 3 jta transaction with hibernate exception during deployment on jes ...

32. Spring JPA and transaction exceptions    forum.springsource.org

Jul 24th, 2006, 04:50 PM #1 schrepfler View Profile View Forum Posts Private Message Member Join Date Aug 2005 Location Bologna, Italy Posts 78 Spring JPA and transaction exceptions Hi, I've ...

33. Exception when using the TransactionProxyFactoryBean    forum.springsource.org

Exception when using the TransactionProxyFactoryBean Hi there, I'm just going to give you the sources, the xml appContext and the resulting exception. Only the relevant parts, as far as I can ...

34. Spring JPA transaction code swallows exceptions    forum.springsource.org

Spring JPA transaction code swallows exceptions Stumbled on this one while developing a Spring-JPA application. At some point in time, I discovered that some pieces of my code trigger the Hibernate's ...

35. Unable to catch exceptions in transactional objects    forum.springsource.org

Unable to catch exceptions in transactional objects Hi, I am encountering a problem with catching exceptions. I have three objects (names changed to protect the innocent): MyDWR MySvc MyDao All three ...

36. Cannot catch Rollback Exceptions with @Transactional    forum.springsource.org

Cannot catch Rollback Exceptions with @Transactional Hi, I cant seem to find an elegant solution to this problem. I have a Service Layer which callls my DAO Layer. My business methods ...

37. Hibernate JPA + Extended EM = exception "Transaction already active"    forum.springsource.org

Dec 5th, 2006, 11:52 AM #1 ASavitsky View Profile View Forum Posts Private Message Member Join Date Aug 2005 Posts 36 Hibernate JPA + Extended EM = exception "Transaction already active" ...

38. AnnotationSessionFactoryBean + JTA = Property exception    forum.springsource.org

AnnotationSessionFactoryBean + JTA = Property exception Hi there, I tried switching from LocalSessionFactoryBean to AnnotationSessionFactoryBean and I'm encountering a problem with . org.springframework.beans.TypeMismatchException: Failed to convert property value of type ...

39. Unable to rollback when checked exception is thrown    forum.springsource.org

Unable to rollback when checked exception is thrown Hi, I am new to Spring and esp Spring 2.0. I am planning to use Spring's AOP based transaction handling in a java ...

40. Transaction and exception handling questions    forum.springsource.org

Transaction and exception handling questions Hi. In my application, I have a couple of DAOs and facades. (DAOs are implementing using Spring's HibernateDaoSupport). Consider the following facade's method : Code: public ...

41. Transaction rollback only on one exception    forum.springsource.org

Transaction rollback only on one exception Hi i have this problem. I need to define a transaction only to rollback on a single exception. I dont want to rollback on any ...

42. integration testing and exceptions/rollbacks    forum.springsource.org

integration testing and exceptions/rollbacks I'm fairly new to Spring, and I'm trying to get integration testing working using AbstractTransactionalSpringContextTests, and I'm having problems figuring out how to test rollbacks. Here is ...

43. newbie Q: intended use of exceptions to rollback transactions    forum.springsource.org

Jul 25th, 2007, 11:54 AM #1 stephenhartley View Profile View Forum Posts Private Message Junior Member Join Date Jul 2007 Posts 2 newbie Q: intended use of exceptions to rollback transactions ...

44. Unexpected Rollback exception    forum.springsource.org

Unexpected Rollback exception - XA transactions I am using Weblogic 9.2 with JTA and XA datasources. I'm using a DefaultMessageListenerContainer running 6 concurrent threads. The MessagListener delegates to a business facade ...

45. change type of any exception after transaction completes    forum.springsource.org

change type of any exception after transaction completes Hallo, i am using transaction advice (tx:advice) to handle all the transactions in service layer of my application. My transaction manager is "org.springframework.orm.hibernate3.HibernateTrans ...

46. Transaction can't rollback when throw exception    forum.springsource.org

Transaction can't rollback when throw exception Dear all The transaction can't rollback when throw exception. Are there any wrong about my Spring configuration? Code:

47. Rollback of chunk on exception    forum.springsource.org

Rollback of chunk on exception We have the following scenario: The ItemProcessor processes a dataset and has to update two database tables or other resources. During this processing it might happen ...

48. TransactionProxyFactoryBean cause exception "$Proxy1 cannot be cast..."    forum.springsource.org

TransactionProxyFactoryBean cause exception "$Proxy1 cannot be cast..." Hi, I'm trying to manage transactions, in a Swing application. Adding in the applicationContext.xml a TransactionProxyFactoryBean (with its target and its HibernateTransactionManager), caused this ...

49. @Service and no transaction is in progress exception    forum.springsource.org

Mar 12th, 2008, 01:23 PM #1 bzren View Profile View Forum Posts Private Message Junior Member Join Date Mar 2008 Posts 1 @Service and no transaction is in progress exception Hi, ...

50. @Transactional Exception Mapping    forum.springsource.org

@Transactional Exception Mapping I have a web service that is annotated with both @Transactional and @WebService using cxf or jaxws-rt as the web service and Atomikos JTA and Hibernate JPA as ...

51. Spring @Transactional LazyLoad exception    forum.springsource.org

Spring @Transactional LazyLoad exception First, I am not using OSIV nor a HibernateInterceptor, because the transaction annotation binds to a HibernateTransactionManager, which knows to create a Session and binds it to ...

52. Exception handling and transaction management    forum.springsource.org

Exception handling and transaction management I have a 3-tier application. The server uses Hibernate and Spring's (annotated) transaction-management to access a database. Clients communicate with the server via RMI (RmiServiceExporter/RmiProxyFactoryBean). Now ...

53. Transaction rollbacked when an exception is thrown    forum.springsource.org

Transaction rollbacked when an exception is thrown Hi there, I have a service call MailService, that throws an exception if (for example) it can not connect to the distant mail server. ...

54. Will no-rollback-for work for Runtime Exceptions?    forum.springsource.org

Will no-rollback-for work for Runtime Exceptions? The Spring reference guide states: "..the Spring Framework's transaction infrastructure code will, by default, only mark a transaction for rollback in the case of runtime...exceptions. ...

55. Newbie Question: Transaction Exception Translation    forum.springsource.org

Newbie Question: Transaction Exception Translation Hi. I am building a web service which performs some create operations. I am using Spring and JPA persistence with a hibernate implementation (and using Annotations ...

56. Transaction roll back Exception    forum.springsource.org

Transaction roll back Exception Hi All, When refering another transaction from an existing one, we get a Transaction Roll Back Exception. Here in the below case, I am refering documentManager, in ...

57. Transactions - Why do I need -Exception?    forum.springsource.org

Transactions - Why do I need -Exception? I spent some time recently trying to debug why my transaction wasn't being rolled back when an exception was thrown. My configuration was as ...

58. RollBack when we throw a custom exception    forum.springsource.org

RollBack when we throw a custom exception Hi, I'm using Spring Batch 1.1.0. I'm using listeners to log the exception. My problem is the transaction is getting rolled back when exception ...

59. PersistenceExceptionTranslationPostProcessor + JTA vs. plain JPA - Exceptions differ    forum.springsource.org

PersistenceExceptionTranslationPostProcessor + JTA vs. plain JPA - Exceptions differ Hi, i am using the PersistenceExceptionTranslationPostProcessor which does work fine using JPA and org.springframework.orm.jpa.JpaTransactionManager. My DAOs are annotated with @Repository and all ...

60. Spring, JPA and Glassfish org.springframework.transaction.UnexpectedRollback Exception    forum.springsource.org

Spring, JPA and Glassfish org.springframework.transaction.UnexpectedRollback Exception Hi, When I user Spring with JPA and Glassfish, I get the following exception. org.springframework.transaction.UnexpectedRollback Exception: JTA transaction unexpectedly rolled back (maybe due to a ...

61. Getting Transaction Exception while implementing programatic transaction management.    forum.springsource.org

Apr 27th, 2009, 05:25 PM #1 jolmstead2k@yahoo.com View Profile View Forum Posts Private Message Junior Member Join Date Oct 2004 Posts 1 Getting Transaction Exception while implementing programatic transaction management. I ...

62. How do you test for lazyInitialization exception with spring transactions?    forum.springsource.org

What is the best way to test for LazyInitializationException when using spring's transactional test framework? If I use @NotTransactional, then Hibernate can't find the session because it wasn't created, but if ...

63. no-rollback-exception-classes and Tasklet (not a chunk oriented step)    forum.springsource.org

no-rollback-exception-classes and Tasklet (not a chunk oriented step) how can i specify the no-rollback-exception-classes in a Tasklet (not a chunk oriented step), just a simple tasklet. My class, implementing tasklet interface, ...

64. SpringJUnit4ClassRunner: Rollback exception instead of Cause    forum.springsource.org

SpringJUnit4ClassRunner: Rollback exception instead of Cause Hello, I use the SpringJUnit4ClassRunner JUnit test runner with Transactional tests (using the @Transactial annotation). The Tests access an in-Memory DB (H2) via Hibernate (JPA). ...

65. Writing exceptions to a 'transactional' file?    forum.springsource.org

Writing exceptions to a 'transactional' file? I'm using SB2 and have a simple batch job reading from a db, transforming and writing items to a file. Then a tasklet sends the ...

66. Exception catching and transactions    forum.springsource.org

Hi, I'm using the NotifyingExceptionRespolver class in order to log all exceptions thrown by my application to the database. I have a DB notification class as follows: Code: @Transactional(propagation=Propagation.REQUIRES_NEW) public void ...

67. Transaction Rolled Back with spring and OpenMq exception    forum.springsource.org

Transaction Rolled Back with spring and OpenMq exception Hi Spring Experts, I am integrating openMQ with spring JMS support and getting exception during transaction with Broker. I am having some questions ...

68. rollback for checked exceptions    forum.springsource.org

Code: @Transactional(propagation=Propagation.REQUIRED, rollbackFor=Exception.class) public TradeData placeTrade(TradeData trade) throws Exception { try { insertTrade(trade); updateAcct(trade); return trade; } catch (Exception up) { //log the error throw up; } } this way I ...

69. Transaction Manager appears to be eating the runtime exception?    forum.springsource.org

Aug 26th, 2009, 02:36 PM #1 pkrasko View Profile View Forum Posts Private Message Junior Member Join Date Jan 2009 Posts 23 Transaction Manager appears to be eating the runtime exception? ...

70. Problem with rollback on exception    forum.springsource.org

Problem with rollback on exception Hi, I have spring application, accessing Postgres (8.x) database through Hibernate 3. In recent time i have noticed that DB changes in my service method are ...

71. Rollback on Exception using @Transactional    forum.springsource.org

Sep 5th, 2009, 02:42 PM #1 mah01 View Profile View Forum Posts Private Message Member Join Date May 2007 Posts 38 Rollback on Exception using @Transactional Hi I've read a lot ...

72. Transaction exception    forum.springsource.org

Sep 10th, 2009, 02:38 PM #1 springilu View Profile View Forum Posts Private Message Junior Member Join Date Jun 2009 Posts 23 Transaction exception If the file processing fails in the ...

73. Rollback exception    forum.springsource.org

Rollback exception Hello, Can some help me to find the actual cause of the following error. Stack trace is as follows: 02-Nov-09 16:21: PM. ERROR TaskletStep.doInChunkContext :314 - Rollback caused by ...

74. Exception Description: No transaction is currently active    forum.springsource.org

Feb 1st, 2010, 01:44 PM #1 alvinhenrick View Profile View Forum Posts Private Message Junior Member Join Date Jan 2010 Posts 2 Exception Description: No transaction is currently active Hi All, ...

75. How to Handle Optmistic Lock Exceptions?    forum.springsource.org

How to Handle Optmistic Lock Exceptions? I am using Eclipselink extension of Optimistic Locking to ensure data consistency between transactions. My application throws optmisticLockException when trying to update a field multiple ...

76. Rollback exception    forum.springsource.org

Thank u so much i rectified this error .But i am getting Transaction not bound error .i am using tomocat 6.0.18 version i configured in conf/server.xml lke Code: Business Layer<-->DAO Layer]. Any ...

79. Transaction do not rollback with exception    forum.springsource.org

Apr 21st, 2010, 07:43 AM #1 raja_s_patil View Profile View Forum Posts Private Message Member Join Date Jan 2009 Posts 56 Transaction do not rollback with exception Hi, I am new ...

80. Write exception when Rollback=false in test and FlatFileItemWriter closed in code!    forum.springsource.org

Write exception when Rollback=false in test and FlatFileItemWriter closed in code! We are trying to test our spring batch file generation code through transactional TestNG class. We have used the FlatFileItemWriter ...

81. JPA, JTA GlassFish - No transaction is currently active exception    forum.springsource.org

JPA, JTA GlassFish - No transaction is currently active exception I'm using Spring 3.0.2 with EclipseLink 2.0.0 inside of a GlassFish container. I've got my Dao objects annotated with @Transactional at ...

82. JPA, JTA GlassFish - No transaction is currently active exception    forum.springsource.org

JPA, JTA GlassFish - No transaction is currently active exception I'm using Spring 3.0.2 with EclipseLink 2.0 and GlassFish 3.0.1. I'm having a Transaction issue that is preventing me from inserting ...

83. @Transactional and Checked Exceptions for Rollback    forum.springsource.org

@Transactional and Checked Exceptions for Rollback Hi everyone, I am using Spring 2.5.6 (slated to upgrade to 3.0 later this year) and we use the @Transactional annotation for transaction management for ...

84. Rollback for checked exception by default    forum.springsource.org

In our project we are migrating from WebLogic to Spring and have faced with that Spring rollbacks transactions only if there unchecked exception or error occurs. Also for marking transactional method ...

85. Any ways to rollback transaction other than throwing exception?    forum.springsource.org

Any ways to rollback transaction other than throwing exception? Hello, In order to rollback the transaction used by each job execution, throwing exception in processor or writer is the only way? ...

86. transactionManager does not roll back transaction on Exception    forum.springsource.org

transactionManager does not roll back transaction on Exception Below are codes from my xml file Code: ...

87. Transaction do not rollback with exception    forum.springsource.org

Nov 12th, 2010, 05:57 AM #1 Dwayne879 View Profile View Forum Posts Private Message Junior Member Join Date Nov 2010 Posts 2 Transaction do not rollback with exception Hi, I am ...

88. Exception Handling in Spring transaction management    forum.springsource.org

Exception Handling in Spring transaction management Assuming i have a method which i want to be used for transaction management public void store() { //DB save in table 1 getHibernateTemplate().save(obj1); //DB ...