Questions tagged [transactional]

A transaction is a collection of operations performed on a database that are supposed to execute in one unit.

A transaction is a collection of operations performed on a database that are supposed to execute in one unit. This means that in case any of the operations fails the entire transaction fails and the status of the database is rolled back to the status prior to the transaction.

Apparently this tag is only useful for databases that actually support transactions.

770 questions
8
votes
3 answers

Spring boot 2 @Transactional annotation makes Autowired fields null

I'm trying to use @Transactional annotation in a method on my service to lazily load a field. However using @Transactional on my Implementation class makes all autowired fields null. Here is my implementation : @Service public class UserServiceImpl…
Mohamed
  • 113
  • 1
  • 2
  • 7
8
votes
1 answer

What is the use of @Transactional annotation

I am new to the EJB Projects. And am trying to understand the usage of @Transactional annotation at top of my EJB methods. I have searched for the content and there is no clear explanation on this. Can anyone explain clearly about this.
Arun
  • 609
  • 2
  • 12
  • 33
8
votes
2 answers

Spring-JPA: updating parent Entity fails to persist new child Entities, interpreting them as Transient instead

I'm new to Spring/JPA/Hibernate, and while it sounds easy reality just hasn't been. I could use some help. I have a parent Entity that holds a list of child Entities. I'll use these to keep the discussion simple: @Entity public class Parent { …
Didjit
  • 785
  • 2
  • 8
  • 26
7
votes
2 answers

How to use @Transactional annotation in Spring boot

I am working on a spring-boot project. Before using @Transactional annotation in my project I have two questions Best practice to use @Transactional annotation in spring-boot, service layer or DAO layer? If the service layer then where do I use…
7
votes
2 answers

Spring Transactional slows down complete process

I am trying to analyze a situation where I have two classes. One class is ProcessImpl which is starting point and internally calls other child transactions.I dont know whats going wrong. The processImpl is importing some stuff and writing related…
swapyonubuntu
  • 1,952
  • 3
  • 25
  • 34
7
votes
1 answer

What is interface-based proxying?

I was reading this regarding to where to place Transactional(interface vs implementation): The Spring team's recommendation is that you only annotate concrete classes with the @Transactional annotation, as opposed to annotating interfaces. You…
melonT
  • 387
  • 3
  • 13
7
votes
0 answers

Illegal attempt to enlist multiple 1PC XAResources

We have Multiple Transaction Managers (WebsphereUOWTransactionManager and DatasourceTransactionManager) and use Mybatis and NamedParameterJdbcTemplate (legacy code) The code used to work and the changes made are to move @Transactional to the Service…
Harry
  • 546
  • 6
  • 22
  • 50
7
votes
1 answer

Is the CrudRepository .delete() method transactional?

When using Spring-data it is possible to extend the CrudRepository. How does this Repositories .delete() method work "under the hood"? Also, is this method Transactional? If this is the case, is there any need to use @Transactional annotations when…
java123999
  • 6,974
  • 36
  • 77
  • 121
7
votes
2 answers

Alternatives to using Transactional NTFS

Given that Microsoft has deprecated Transactional NTFS (TxF): Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF was developed for can be achieved through simpler and more…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
7
votes
0 answers

Spring data repository @Autowiring is null when using @Transactional annotation on service bean

I am studying spring framework and trying to use it in my project. But I have came across the following problem with spring data repository and @Transactional annotation used in my service. The problem is that there are no exceptions on the spring…
6
votes
2 answers

LazyInitializationException Within a @Transactional Method

I am running into the org.hibernate.LazyInitializationException error when I try to access a lazy loaded exception when excecuting the following: @Transactional public void displayAddresses() { Person person = getPersonByID(1234); …
Tyler Murry
  • 2,705
  • 3
  • 29
  • 46
6
votes
4 answers

Spring Bean Hangs on Method with @Transactional

Just a little background , I'm a new developer who has recently taken over a major project after the senior developer left the company before I could develop a full understanding of how he structured this. I'll try to explain my issue the best I…
Rhouujin
  • 101
  • 2
  • 6
6
votes
3 answers

Rails and Mailchimp - Welcome email

I need to send out a welcome email whenever a user registers in our website. I have created a campaign in mailchimp for this. I have also hooked up the hominid gem. So, each time, I add users to the group (welcome_email group), I want to resend the…
ddb
  • 1,416
  • 11
  • 17
6
votes
3 answers

Hibernate, Spring, @Transactional - surround with try/catch?

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 management with Spring), do I have to…
nano7
  • 2,455
  • 7
  • 35
  • 52
6
votes
3 answers

Spring transactional context doesn't persist data

I know that my problem is a common problem, but I've checked a lot of questions here, checked Spring documentation and I really don't know what I am doing wrong. My problem: I've got a Spring WebFlow project using JPA (implementation: OpenJPA +…
Arek Woźniak
  • 695
  • 3
  • 12
  • 25