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
10
votes
2 answers

Why must methods annotated with @Transactional be overrideable

I have the following code: /** * Restored deleted partner */ @Transactional public void restorePartnerById(Integer id){ // logic } When I make the method final /** * Restored deleted partner */ @Transactional public final void…
10
votes
1 answer

Mule / Spring transaction is not propagated

I have a problem with database transactions in mule flow. This is the flow that i have defined:
Klapsa2503
  • 829
  • 10
  • 33
10
votes
5 answers

C++ Transaction-like Pattern for All or Nothing Work

Suppose I have two functions DoTaskA and DoTaskB—both capable of throwing TaskException—with their corresponding "rollback" functions UndoTaskA and UndoTaskB. What is the best pattern to use so that either both succeed or both fail? The best I have…
kirakun
  • 2,770
  • 1
  • 25
  • 41
9
votes
2 answers

Entities Not Persisting - Spring + Hibernate + JPA

I'm using Spring + Hibernate + JPA and I have a situation where I can't get my entities to persist to the database. I've set up a service class that is annotated with @Transactional. It uses a DAO that contains an injected EntityManager. When I call…
threejeez
  • 2,314
  • 6
  • 30
  • 51
9
votes
1 answer

Spring @Retryable with stateful Hibernate Object

I am trying to make my Service Method retrying on failure with Springs @Retryable. @Retryable(backoff = @Backoff(delay = 1000), maxAttempts = 3) @Transactional(rollbackFor = Throwable.class) public Something saveSomething(Something something) { …
9
votes
3 answers

Spring3 's @Transactional @Scheduled not committed to DB?

This is my 1st time trying Spring3's @Scheduled , but found I cannot commit to DB. This is my code : @Service public class ServiceImpl implements Service , Serializable { @Inject private Dao dao; @Override @Scheduled(cron="0 0 * * * ?") …
smallufo
  • 11,516
  • 20
  • 73
  • 111
9
votes
2 answers

HowTo extend Spring Annotation @Transactional

I have to use 3 different transaction managers in my webapp. So I wrote my own Annotation according to the Spring reference (Section 10.5.6.3 Custom shortcut annotations). One annotation (for using one specific transactionmanager) looks like…
tim.kaufner
  • 1,247
  • 5
  • 13
  • 22
9
votes
2 answers

Spring Transactional TimeOut

I am trying to use spring @Transactional annotation and timeout parameter. I basically test the code with put some Thread.sleep() codes. Then i get timeout exception as i expected. Also i want to get timeout exception when database operations take…
Uğur Yeşilyurt
  • 1,339
  • 2
  • 12
  • 21
9
votes
3 answers

Spring @Transactional and inheritance

I do have a generics-based DAO class, which is base for all other DAO classes in my project and contains common functionality: public class Dao { private SessionFactory factory; public void setSessionFactory(SessionFactory factory) { …
Laimoncijus
  • 8,615
  • 10
  • 58
  • 81
9
votes
1 answer

SQL Server 2008 transactional replication 'Missing end comment mark '*/''

I'm trying to set up transactional replication on a Dynamics NAV database on SQL Server 2008 R2 SP1. Using the same servers I have been able to set up replication successfully on a different DB. I'm able to create the publication, subscription and…
8
votes
3 answers

Declarative transactions (@Transactional) doesn't work with @Repository in Spring

I'm trying to make simple application using Spring, JPA and embedded H2 database. Recently I've come across this strange issue with declarative transactions. They just doesn't commit if I autowire my DAO with @Repository annotation. More…
SpyBot
  • 487
  • 2
  • 6
  • 16
8
votes
1 answer

Some questions about Grails service

I am working with a Grails web application and I get so many strange things when using Grails service. So I want to ask some questions on this to make me understand more about Grails services. This will be very helpful for me (and maybe for others…
Đinh Hồng Châu
  • 5,300
  • 15
  • 53
  • 90
8
votes
1 answer

Spring nested @Transactional method and rollback

I have a @Service class which has a @Transactional method that calls another @Transactional method on the same class. I was testing rollback behavior for this and I found that it wasn't working properly. The code looks something like…
JayPea
  • 9,551
  • 7
  • 44
  • 65
8
votes
2 answers

using Async inside a transaction in Spring application

I have a Spring application which updates particular entity details in MySQL DB using a @Transactional method, And within the same method, I am trying to call another endpoint using @Async which is one more Spring application which reads the same…
8
votes
1 answer

Apache Transaction:write file transactionally - how to use resourceId

If anybody implemented transactional writing to file,please, assist me. Related topic was discussed in earlier thread(transactional write). Use case is following: if writing to log file is failed,that appropriate DB transaction shoud be rolled…
sergionni
  • 13,290
  • 42
  • 132
  • 189
1 2
3
51 52