dao « Transaction « Spring Q&A





1. Automatic Hibernate Transaction Management with Spring?    stackoverflow.com

How far does the spring framework go with transaction handling? My reading of the book "Spring In Action" suggestions with its examples that you create DAO methods that don't worry about ...

2. Spring @Transactional Annotation Best Practice    stackoverflow.com

We are currently discussing the Best Practice for placing the @Transactional annotations in our code. Do you place the @Transactional in the DAO classes and/or their methods or is it better to ...

3. Transaction between several DAO layers?    stackoverflow.com

As shown below, I am accessing a Service layer method inside of another DAO. (Every DAO in the system is implemented using HibernateDAOSupport class) I wanted to rollback the transaction when #1 or ...

4. Spring Transactions in diffrent DAOs does not work anyway?    stackoverflow.com

Here is my implementation in summary 1) all DAOs implemented using HibernateDAO support/ @Transational annotation is only used in Service layer 2) Use MySQL / HibernateTransactionManager 3) Test using main(String args[]) method (do ...

5. Spring Annotations not working    stackoverflow.com

I posted this to the spring forums, sorry for the xpost. I am new to spring. I am working on an existing project that uses spring 1.2.8 (old, I know), and java ...

6. Is there a transaction management for DAO in Spring framework?    stackoverflow.com

Is there any kind of out-of-the-box transaction management support for pure DAO in Spring framework?

7. Is automatic rollback of DAO integration tests with Spring Test a good practice?    stackoverflow.com

If I were to annotate my DAO integration test methods with @Transactional, Spring Test will happily rollback any changes to the database after each test methods completes. These seems extremely ...

8. Spring @Transactional wrapping 2 methods    stackoverflow.com

I'm a Spring newby. I use the @Transactional annotation for my dao methods:

@Transactional
public Person getById(long id) {
    return new Person(jdbcTemplate.queryForMap(...));
}

@Transactional
public void save(Person person) {
    jdbcTemplate.update(...);
}
and ...

9. Transactions not working unless inside DAO    stackoverflow.com

I have a problem with transactions in that annotating a service that calls a DAO with @Transactional throws an exception stating that the Session is not open. The only way I ...





10. Where should "@Transactional" be place Service Layer or DAO    stackoverflow.com

Firstly it is possible that I am asking something that has been asked and answered before but I could not get a search result back . Okay generally (or always so ...

11. use of @org.springframework.transaction.annotation.Transactional outside of the DAO layer?    stackoverflow.com

i have a quite classical issus : Access Lazy Collection outside of the DAO, witch lead to LazyInitializationException. Is that a clean and reasonable solution to use @Transactional one some method of ...

12. Spring Data Jpa / Hades Transaction Behaviour    stackoverflow.com

From Spring Data JPA reference (previously Hades),

CRUD methods on repository instances are transactional by default.
If a method covers more than one repository, example:
  ...

13. Manual Transactional Service and DAO layer for JPA with Spring    stackoverflow.com

I am using JPA with Spring. If I were to let Spring handle the transactions, then this is what my Service layer would look like assuming the EntityManager has been properly ...

14. Spring jpa transaction business to Dao    stackoverflow.com

business layer:

public class ServiceImpl implements Service{
@Transactional(readOnly = false) public void createOrUpdateAppPing(String s) {
  servicePingDao.createOrUpdateAppPing(s);
} } Dao layer
public   void createOrUpdateAppPing(String sc) {
      EntityManager ...

15. Spring integration test does not roll back    stackoverflow.com

I'm using Spring + Hibernate + H2. I do database operations in my integration tests (by calling a service class). I want Spring to rollback the changes after each test method, ...

16. Transaction Across Multilple DAO    forum.springsource.org

It seemed I have problems managing transaction across multiple DAO's. I am opening a transaction in the beginning of a request through using one Struts interceptor, and then the action is ...





17. Service and DAO layer - transactions and entity manager    forum.springsource.org

Service and DAO layer - transactions and entity manager Hello, I use transactions in Dao layer, but I'd like to move them to the service layer and I'm not sure how ...

18. Spring Hibernate Service DAO Transactions Tutorial    forum.springsource.org

Spring Hibernate Service DAO Transactions Tutorial Hi, I am trying to integrate my project with Spring. These are just baby steps for me. I am looking for a good tutorial wherein ...

19. unable to insert/update persist/merge using spring DAO - No JTA transaction found    forum.springsource.org

Mar 7th, 2011, 07:26 PM #1 davestar View Profile View Forum Posts Private Message Junior Member Join Date May 2009 Location Denver, CO Posts 17 unable to insert/update persist/merge using spring ...

20. Spring&Hibernate, DAO, Transactions, Management    forum.springsource.org

Spring&Hibernate, DAO, Transactions, Management Hello together, Im working on developing a webapplication with Spring 3.0.5, Hibernate 3.6 and MySQL Server 5.1. After researching a lot, I decided to write my DAO ...

21. How to do Hibernate Transactions in Spring outside of DAO Classes    forum.springsource.org

How to do Hibernate Transactions in Spring outside of DAO Classes I have a block of code which includes calls to various DAO classes. e.g.: //BEGIN for (int i = 0; ...

22. Use of @Transactional in DAO-Interface    forum.springsource.org

Use of @Transactional in DAO-Interface Hi, I'm using Spring with Hibernate-JPA on a Glassfish server. In my application I have service and a dao layer. My question is, if it's a ...

23. How to make transactions span multiple DAO-ops?    forum.springsource.org

How to make transactions span multiple DAO-ops? Hi! This is a question about DAOs, business objects and how to make their (i.e the business objects) transaction-safe. One of the Spring distribution ...

24. DAO testing using client-side transaction demarcation    forum.springsource.org

DAO testing using client-side transaction demarcation Hello, How can i create transaction demarcation from my test case which tests a DAO(data access object). public class DAO{ public void a(){ //some db ...

25. Service vs. DAO vs. transaction vs. design question    forum.springsource.org

Service vs. DAO vs. transaction vs. design question I am trying to figure out the exact role of services and how they are used in relationship to dao objects. I have ...

26. Synchronization question on WeatherService Dao    forum.springsource.org

This is regarding the example WeatherService Dao on page 40 of the "Java Development with the Spring Framework" book. This code does not appear to be thread safe but appearances are ...

27. Transaction Problem with JDBC DAOs    forum.springsource.org

Transaction Problem with JDBC DAOs Hi, I'm trying to define my application transaction in a declarative way, but i'm having problems with a PROPAGATION_REQUIRES_NEW method since it is executed in current ...

28. Can't RollBack Spring DAO method calls from SSLB    forum.springsource.org

Can't RollBack Spring DAO method calls from SSLB I am finding it very hard to find a solution to the below situation: A method in one of our SSLBs performs database ...

29. Good way for transaction, jdbc, exception, dao    forum.springsource.org

Hi, I'm novice with spring / ioc and spring jdbc. I lurn how to use jdbc spring. Now, i wish complete my small framework with transaction support ( jta ) and ...

30. Declarative Transactions across multiple DAOs    forum.springsource.org

Declarative Transactions across multiple DAOs Hi, I've got a situation where I have multiple DAOs for different areas of data storage in an application, but all use a common Data Source ...

31. spring transactions - DAO with multiple resources - problem    forum.springsource.org

spring transactions - DAO with multiple resources - problem Hi all, I have a problem with my DAO which accesses multiple databases. Each method in that DAO accesses only one database ...

32. Spring transactions wiring with Hibernate DAOs local transactions    forum.springsource.org

Spring transactions wiring with Hibernate DAOs local transactions Hi All, I have been going through the forums to get the best possible help but I have a scenario where I am ...

33. Rollback a non-dao operation with AbstractTransactionalDataSourceSpringContextTests    forum.springsource.org

Rollback a non-dao operation with AbstractTransactionalDataSourceSpringContextTests Hi Folks, I'm working on a test class that extends AbstractTransactionalDataSourceSpringContextTests. When my tests exercise database operations through methods in my dao, all works well. ...

34. Spring DAO transaction rollback issue    forum.springsource.org

Spring DAO transaction rollback issue Current i am facing problem in rollback the database changes. I am using a Bean Managed Session Bean to call the DAO to execute the database ...

35. Excempting a dao call from rollback    forum.springsource.org

Excempting a dao call from rollback Hi Folks, In dao methods, I'm using a logging stored proc for auditing purposes. Basically I need to perform a log action at the start ...

36. One Transaction for each DAO    forum.springsource.org

If you are proxying your Dao with TransactionProxyFactoryBean then all transactions will be at the Dao level. What your would need to do is proxy something higher up the stack. It ...

37. How to wrap 3 dao calls in 1 transaction ?    forum.springsource.org

How to wrap 3 dao calls in 1 transaction ? I am trying to get declarative transaction management going. As a NOOB, it is not going all that well. Environment Spring ...

38. DAO Templates and Transactions    forum.springsource.org

I'm using hibernate template and in application-context.xml i define transaction properties for my services. in "spring in action" book, "consistent dao support" part, it shows that template class also start a ...

39. designing a dao that supports transactions?    forum.springsource.org

designing a dao that supports transactions? I have a service class that uses a dao to fetch data from a database, then creates a text file of invoices from the data ...

40. DAO and service layer transaction discussion    forum.springsource.org

DAO and service layer transaction discussion Hi all, I am designing a large website and I'm doing a study into transactions and the whole DAO and service layer structure. I would ...

41. Multiple Transaction Managers on the same DAO?    forum.springsource.org

HI there. We think about integrating sping for a while. But I came across a possible showstopper today. We have multiple databases with exactly the same schema. So there is one ...

42. Transactions with multiple daos? :S    forum.springsource.org

Transactions with multiple daos? :S Im kinda new to spring but here goes: How do i make a transaction that uses multiple daos? Code: ...

43. How to run 2 DAO calls in same transaction?    forum.springsource.org

How to run 2 DAO calls in same transaction? Hi all, I'm having some trouble designing my service methods. I'm using Spring as object factory for struts2, and also for transaction ...

44. Transaction not active in DAO while trying to call hibernatesession.contains    forum.springsource.org

Transaction not active in DAO while trying to call hibernatesession.contains I am trying to reattach a detached entity to the hibernatesession using the lock method in a DAO. Before calling the ...

45. DAO @Transactional    forum.springsource.org

I have an understanding problem with @Transactional annotation. That is part from my Dao class: Code: @Transactional(propagation=Propagation.NEVER) public Serializable save(Treeversion transientInstance) { try { Serializable pk = getHibernateTemplate().save(transientInstance); return pk; } ...

46. Hibernate and DAO Transaction issue    forum.springsource.org

Hibernate and DAO Transaction issue Hi All, Issue : Record which I have created in Hibernate is not available in DAO " Background: I am using Websphere 6.0 application server without ...

47. Transactions in Service and DAO Layers    forum.springsource.org

Transactions in Service and DAO Layers I have a fundamental question concerning Transactions. I am hoping a more experience developer can help explain this area to me. First, I have a ...

48. Should DAOs handle transactions?    forum.springsource.org

Should DAOs handle transactions? I have been struggling to understand the connections between data persistence layer, DAOs, Service classes and how transaction management fits into this framework. So please don't get ...

49. Hibernate DAO using Dynamic Maps (updates outside @Transactional)    forum.springsource.org

Hibernate DAO using Dynamic Maps (updates outside @Transactional) So I have a service that retrieves a record from a DAO layer object whose method is @Transactional(readOnly=true). OUTSIDE the annotated method, I ...

50. Same datasource of the DAOs under the same transaction manager ?    forum.springsource.org

Same datasource of the DAOs under the same transaction manager ? Hello all , Could anyone kindly suggest how to check (as well as configurate) the DAOs under the same transaction ...

51. Transaction spanning multiple DAOs    forum.springsource.org

How do I have a transaction span multiple DAOs that are implemented using SimpleJdbcTemplate? 1. Do I simply use the Transactional annotation on a method that contains calls to multiple DAOs ...

52. IN_ACTIVE TRANSACTIONS left behind in case of exception in jdbc dao module    forum.springsource.org

Hello, I'm using spring jdbc+ transaction module in stand alone java project. Though I'm doing context.registerShutdownHook(), I see IN_ACTIve TRANSACTION left behind(even after application shutdown/dies) in case of any error. this ...

53. Transaction Handling across DAOs    forum.springsource.org

Transaction Handling across DAOs Hi All, In my application, i have a DAO, say UserDAO, has a createUser() method which insert one row into users_master table and one row in user_addresses ...

54. Where should I use Transaction? Service or DAO? Or both?    forum.springsource.org

Where should I use Transaction? Service or DAO? Or both? Dear All, I am building an application with Hibernate + Spring, and i'm starting to write some methods with lots of ...

55. Transaction Management across different Daos    forum.springsource.org

Transaction Management across different Daos Hi, I am a Spring newbie and I have an issue or questions relating to transaction management. I have a service implementation that creates an audit ...

56. Transaction management across different Daos    forum.springsource.org

This is a bump from the thread here but I have not received any reply yet. I am hoping that a bigger audience will help me here. I wanted to know ...

57. TransactionManager per DAO?    forum.springsource.org

TransactionManager per DAO? I have several DAOs which all work with the same data resource (particularly, JCR), and some of them are even more specific, i.e., work only within the same ...

58. getting 2 dao's to participate in the same jta transaction?    forum.springsource.org

getting 2 dao's to participate in the same jta transaction? hi.. i have 2 dao's with different entity managets to different databases, my configuration is this: Code: ...

59. DAO exceptions aren't caught in service with my transactions setup    forum.springsource.org

DAO exceptions aren't caught in service with my transactions setup Hi all. I am using such confuration to make my services transactional: Code: