thread « Transaction « Spring Q&A





1. Testing simultaneous calls to transactional service    stackoverflow.com

How should I test a service method that is transactional for its simultaneous use (it updates a database row by decreasing a value)? I have setup a JUnit test class with SpringJunit4ClassRunner ...

2. Spring Tests : transaction not rolling back after test method executed    stackoverflow.com


I'm trying to create integration tests for a legacy application deployed on Weblogic 8.1 using a subclass of AbstractTransactionalJUnit4SpringContextTests. My test method has the following annotations :

@Test
@Rollback(true)
public void testDeployedEJBCall throws Exception {...}
My ...

3. How to programmatically get transaction manager in a thread?    stackoverflow.com

I have a wicket page , which contains two Spring-managed beans , one is DAO , another is Service Object :

public class MergeAccountsPage extends WebPage
{
  @SpringBean
  private MergeEmailDao mergeEmailDao;

 ...

4. Using threads to run a method that is not part of the transaction?    stackoverflow.com

i have a case where at my JAVA application, inside a transaction i want to call another service (JMS, WebService, SMS gate way, ...etc), i don't want to depend on the ...

5. Spring & Hibernate: no session bound to the thread    stackoverflow.com

Trying to get Srping's transaction management to work but it's not going as I hoped. I get an exception when requesting anything that requires my database:

DEBUG: org.springframework.orm.hibernate3.SessionFactoryUtils - Opening Hibernate Session
DEBUG: org.springframework.orm.hibernate3.SessionFactoryUtils ...

6. No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here    stackoverflow.com

I am getting this exception when I call a DAO method which uses SessionFactory.getCurrentSession(). The DAO class is annotated with @Transactional and I also have <tx:annotation-driven/> declared in the application ...

7. Seeking a Spring (3.0.5) Solution for: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here    stackoverflow.com

I have a Transaction problem on Spring 3.0.5. In my case I get the so-called exception "No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one ...

8. Questions about transaction management    stackoverflow.com

I'm trying to implement a business need with Spring and having some problems about transaction management. The business need is, simply,
1) Query a database(#1) with some criteria.
2) Write the results ...

9. How to propagate Spring transaction to another thread?    stackoverflow.com

Perhaps, I am doing something wrong, but I can't find a good way out for the following situation. I would like to unit test a service that uses Spring Batch ...





10. How to bind a transaction to multiple threads in Hibernate?    stackoverflow.com

Initially the code was in the following structure and it worked perfectly fine - Initial code:

@Transactional
class foo
{
  void public work()
  {
      task1;
    ...

11. Problem with transactions: No Hibernate Session bound to thread    stackoverflow.com

I refactored my service layer to work as generic component. After that all request to my controller began to throw org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not ...

12. "No Hibernate Session bound to thread", transactional method breaks execution of the next transaction    stackoverflow.com

My problem is hidden in class, with 2 methods.

@Repository
@Transactional(isolation = Isolation.READ_COMMITTED)
public class RetentionController {
    @Autowired
    private SessionFactory sessionFactory;
       ...

13. Spring declarative transactions and manually scheduling threads    stackoverflow.com

I'm having a strange issue. In a class I have:

private final ScheduledExecutorService executor 
     = Executors.newSingleThreadScheduledExecutor();

public MyClass(final MyService service) {
    executor.scheduleAtFixedRate(new Runnable() {
   ...

14. spring transactions in a spawned off thread    stackoverflow.com

im working on an existing system and need to have my spring transaction manager attach to a thread thats being spawned off of a master job thread. i keep getting ...

15. No Hibernate Session bound to thread,configuration does not allow of non-transaction    forum.springsource.org

No Hibernate Session bound to thread,configuration does not allow of non-transaction Hi Below is the complete scenario of my problem .. Please help Here is my XML configuration

17. Synchronization/Threading design question for File Writing and Aggregators    forum.springsource.org

Synchronization/Threading design question for File Writing and Aggregators 1- My fisrt question is that I have to write a file at the end of my batch job. This is the same ...

18. multi-threading and long running transactions    forum.springsource.org

multi-threading and long running transactions I am working on improving the performance of an existing spring batch implementation. The current batch works on a largish data set (100k) and basically creates ...

19. session, Transaction and worker threads    forum.springsource.org

session, Transaction and worker threads We are currently using Spring + webwork + Hibernate with the OpenSessionInViewFilter. Everything works great when confined to a single request. However, we now have to ...

20. does Spring have solution of sharing transaction between multi threads    forum.springsource.org

does Spring have solution of sharing transaction between multi threads We meet an scenario that work with multi thread. In the main Thread, do some logic and update the database, in ...

21. Thread Synchronization    forum.springsource.org

Thread Synchronization Hi everyone! I have developed a Spring MVC application that generates report given the inserted data. This reports contains also several images. I've also a button called "checked" that ...

22. Transaction is not active in the current thread    forum.springsource.org

Aug 28th, 2011, 08:31 AM #1 thomasvonkapellen View Profile View Forum Posts Private Message Junior Member Join Date Aug 2011 Posts 9 Transaction is not active in the current thread Hi, ...

23. Hibernate thread local session without a transaction manager    forum.springsource.org

Hibernate thread local session without a transaction manager Hi, I want to copy some data from one database to another one. I am using hibernate so I have two sessionfactory : ...

24. Newbie Hibernate Thread-local Transactions    forum.springsource.org

Newbie Hibernate Thread-local Transactions Hello, This may sound silly, but how do I declare the creation of thread-local Hibernate sessions with simple JDBC transactions? I'm writing a relatively simple web application, ...

25. Hibernate load causes table lock error for multiple threads    forum.springsource.org

Hibernate load causes table lock error for multiple threads Hi all, I have recently begun using Spring and Hibernate in combination, mainly to load objects from the database. The load works ...

26. 2 concurrent transactions/[hibernate]sessions per thread    forum.springsource.org

2 concurrent transactions/[hibernate]sessions per thread Hi all, I wonder how to get two sessions or more for one thread (non-managed environment). Here is the case with Hibernate only: - function1 { ...

27. Spring's transaction infrastructure support mult-threads?    forum.springsource.org

Now ,I have a spring-enabled j2ee application. I want perform my transaction work by way of Spring's transaction infrastructure. But i have to start transaction in thread A, but to commit/rollback ...

28. TransactionProxyFactoryBean proxied method & thread    forum.springsource.org

Hello, I have a thread-safe method which uses sqlMapClientTemplate to return a list directly. If I wrap the method using TransactionProxyFactoryBean (PROPAGATION_REQUIRED, readOnly), will it still be thread safe? FYI, the ...

29. How to use a single Session (per thread) for all transaction    forum.springsource.org

I am currently using the TransactionProxyFactoryBean and HibernateTransactionManager classes to declare the transaction requirements for various functions. How can I configure the classes to alway use the same Session? Thanks.

30. Error on HB session in multiple threads each with its Spring transaction    forum.springsource.org

Error on HB session in multiple threads each with its Spring transaction Hi We are using Springs declarative transaction along with hibernate. Part of our application is batch processing, where we ...

31. Is spawning a new Thread transaction safe?    forum.springsource.org

Is spawning a new Thread transaction safe? Hi, Our Environment is Spring: 1.1.3 Hibernate: 2.1.7c Quartz: 1.5.1 One of the requirements in our project is to schedule a job at early ...

32. wrapping threads in transaction    forum.springsource.org

wrapping threads in transaction Hello, i need to use ThreadPoolExecutor to run different kinds of tasks. Each task should run in newly created Thread, be independent, and be wrapped by TransactionInterceptor. ...

33. Remote Ejb/Transactions and threading    forum.springsource.org

Remote Ejb/Transactions and threading I am currently integrate Spring in an existing application. First of all, it is really easy and a powerful addition to any project. But I have a ...

34. Background Thread to perform transactions causes Hibernate Exception    forum.springsource.org

Hi, I'm having an interesting problem. I'm calling a thread class(my thread class with logic) from from a struts action to perform transactions in the background while i redirect the user. ...

35. Moving a transaction to another thread    forum.springsource.org

Moving a transaction to another thread Short version: does Spring provide any easy way to move a transaction to another thread? Long version: Spring's transaction management is all great if you ...

36. transactions & Threads: how to pass transaction into a new Thread.    forum.springsource.org

transactions & Threads: how to pass transaction into a new Thread. * What I would like: In a MainService, I would like to create a new thread and execute inside this ...

37. AOP interaction with Transaction and Threads    forum.springsource.org

AOP interaction with Transaction and Threads Hi at all, I'm developong a stand alone application for my client and for this task I have used a transaction features in a multithread ...

38. Problems with Transactions and New threads    forum.springsource.org

Problems with Transactions and New threads Hi, I'm having difficulty with transactions and new threads which throw exceptions relating to class not found for Hibernate's HqlToken so I'm wondering if I'm ...

39. Delcarative Transactional Management with multiple threads    forum.springsource.org

Delcarative Transactional Management with multiple threads Hi Folks, I'm working on a Spring (2.0) + Hibernate (3.2) web application (my first). In this web app, I'm using Spring's AOP-based declarative transactional ...

40. Transaction Support Multithreading Apps    forum.springsource.org

Transaction Support Multithreading Apps Hi, We have implemented a transactional application using an ESB framework (Mule) integrated with Spring for the Object Container and Hibernate for the data persistence. We were ...

41. Transactions in multi threaded environment    forum.springsource.org

Transactions in multi threaded environment Hi, I am new to spring and i am having hard time to understand how annotated transactions are working in multi threaded environment. Here is the ...

42. how to clear transaction data from local thread    forum.springsource.org

how to clear transaction data from local thread Hi, Is it possible to clear data stored by Spring in LocalThread and releated to transaction management?? I try to develope test which ...

43. Transaction ands threads    forum.springsource.org

Transaction ands threads What I have is a unit test where I am using my DAO's to setup data via hibernate(Thread 1). After which I start the object I am trying ...

44. Transaction problems in multi-threaded app    forum.springsource.org

Transaction problems in multi-threaded app I have a Spring/Hibernate based multi-threaded application. My application essentially does an async request/response: Thread 1: start transaction do some database work via Hibernate send a ...

45. Error on transaction commit : No value for key xx bound to thread yy    forum.springsource.org

Jan 6th, 2009, 11:20 AM #1 Ougha View Profile View Forum Posts Private Message Junior Member Join Date May 2007 Posts 11 Error on transaction commit : No value for key ...

46. Not able to get a new transaction on spawned threads    forum.springsource.org

Not able to get a new transaction on spawned threads Hello, Im trying to make a web service that launches/stops sub-threads depending on incoming requests. The class that handles the request ...

47. Multi-Threaded transactional problem    forum.springsource.org

Multi-Threaded transactional problem Hello all, I'm writing an application that connects to emailservers and fetches email from them to eventually put it in a Oracle database. I'm doing this multi-threaded to ...

48. Using annotated Transaction and getting No Hibernate Session bound to thread    forum.springsource.org

Jun 25th, 2009, 04:22 PM #1 chris.hurd View Profile View Forum Posts Private Message Junior Member Join Date Jun 2009 Posts 13 Using annotated Transaction and getting No Hibernate Session bound ...

49. How threads handles transactions?    forum.springsource.org

Hi All, I have to execute a method asynchronously and I used Threads for this purpose. So the thread has to take the transaction from it's caller(initiator) and do the CRUD ...

50. jta transaction manager, spring transaction annotations and threads    forum.springsource.org

jta transaction manager, spring transaction annotations and threads I was wondering if anyone knows weblogic/transactions/threading enough to be able to help us with the following question: The application uses spring inside ...

51. Integration testing with transactions on multiple threads    forum.springsource.org

Integration testing with transactions on multiple threads I'm trying to create an integration test to test some of my code which uses an ExecutorService. Inside the tasks executed by this service ...

52. Spring JTA share TX multiple threads    forum.springsource.org

Spring JTA share TX multiple threads I'm using declarative transaction demarcation with Spring. My TX manager is set to JTA. I have a method which runs inside a transaction. It has ...

53. After transaction timeout, timermanager threads hang    forum.springsource.org

After transaction timeout, timermanager threads hang Hi, I hope this is the right forum for this question, I couldn't find an other forum related to this question. Im working on a ...

54. Spring managed transaction and thread safety    forum.springsource.org

Spring managed transaction and thread safety Spring 2.5.6 / Hibernate 3.3.2.GA Code: public abstract class EntityDaoBase, ID extends Serializable> implements IEntityDao { @PersistenceContext(type = PersistenceContextType.TRANSACTION) private EntityManager entityManager; ...

55. problem with spring transaction management with multi-threading    forum.springsource.org

problem with spring transaction management with multi-threading Hi I need to perform some db operations in a multi-thread enviroment. For each thread, the task is the same as below: 1. Check ...

56. Correctly suspending a JTA transaction for resume from anothe thread    forum.springsource.org

Hello I want to read a JMS message with a JTA transaction, suspend it, and make another external call (say HTTP) to which the response is received in a separate thread. ...

57. Cross-thread transactions possible in Spring?    forum.springsource.org

Cross-thread transactions possible in Spring? I'm using spring jdbc and programmatic transactions. I have a "dispatcher" that scans an index table and dispatches the work items in the index to many ...

58. DB Lock exception in multi threaded step execution    forum.springsource.org

DB Lock exception in multi threaded step execution Hi, I am trying to do multi threaded step execution using ''. I am using the persistent job repository model as the in ...

59. Thread bound JDBC connection and transactions    forum.springsource.org

Thread bound JDBC connection and transactions Hi, I am using Spring v 3.0.3, Commons DBCP connection pool and DataSourceTransactionManager for JDBC transactions. Database: Oracle 10g. What I need to achive is ...

60. @Transactional and No Hibernate Session bound to thread    forum.springsource.org

@Transactional and No Hibernate Session bound to thread Hi, I'm aware this is a recurrent topic, but I got stuck on this. I have managed to get @Transactional to work on ...

61. Thread Synchronization issue in JdbcCursorItemReader    forum.springsource.org

Nov 18th, 2010, 12:41 AM #1 mfork00 View Profile View Forum Posts Private Message Junior Member Join Date May 2005 Posts 6 Thread Synchronization issue in JdbcCursorItemReader I encountered the error ...