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
20
votes
5 answers

Difference between transactional and non-transactional

Simply stated: What is the difference between "Transactional" and "Non-Transactional"? In my case I came up with this question while reading the following definition for "MDM": "In computing, master data management" (MDM) comprises a set of …
philips
  • 437
  • 1
  • 5
  • 15
17
votes
3 answers

For web MVC Spring app should @Transactional go on controller or service?

For WebApplicationContext, should I put @Transactional annotations in the controller or in services? The Spring docs have me a bit confused. Here is my web.xml:
user2208384
  • 171
  • 1
  • 1
  • 5
16
votes
3 answers

Spring: automatic rollback on checked exceptions

One way to configure Spring to rollback on a non RuntimeExceptions is using @Transactional(rollbackFor=...) annotation on the service classes. The problem with this approach is that we need to define (rollbackFor=...) for almost all the service…
sara
  • 1,130
  • 2
  • 11
  • 20
16
votes
6 answers

Differences between the Grails @Transactional vs. the Spring @Transactional annotations

Well there was a point in the Grails Declarative Transactions. It said: The grails.transaction.Transactional annotation was first introduced in Grails 2.3. Prior to 2.3, Spring's @Transactional annotation was used. But I can't seem to find out…
haedes
  • 612
  • 2
  • 10
  • 23
15
votes
2 answers

Spring @Transaction not starting transactions

I am using Spring 3 with Hibernate 3. I am trying to configure Spring declarative transaction, but no matter what I try, Spring transaction is not getting started. Here is my configuration File:…
Prashant Kalkar
  • 602
  • 1
  • 7
  • 19
15
votes
3 answers

python mysql delete statement not working

here I am trying to remove any users which containt a " in their email/username. def removeQuote(self, tbl,record): """ Updates the record """ statmt="select id from %s WHERE `email` LIKE '%%\"%%'" % (tbl) …
Cmag
  • 14,946
  • 25
  • 89
  • 140
14
votes
1 answer

Spring: HibernateTransactionManager handling multiple datasources

In the following piece of code (Spring 3): @Transactional("txManager") public class DaoHolder { @Transactional(value="txManager", readOnly=false, propagation=Propagation.REQUIRES_NEW, rollbackFor={Exception.class}) private void…
machinery
  • 3,793
  • 4
  • 41
  • 52
14
votes
1 answer

Can a git repository be corrupted if a command modifying it crashes or is aborted?

When playing around with git, I sometimes try out things, then abort commands which take too long (e.g. some git svn commands that hang during network problems). This got me thinking: Is it always safe to forcefully abort a command (Ctrl-C or kill)?…
sleske
  • 81,358
  • 34
  • 189
  • 227
14
votes
3 answers

Spring @Transactional not creating required transaction

Ok, so I've finally bowed to peer pressure and started using Spring in my web app :-)... So I'm trying to get the transaction handling stuff to work, and I just can't seem to get it. My Spring configuration looks like this:
Steve
  • 2,678
  • 8
  • 40
  • 54
13
votes
1 answer

Compilation error when using @Transactional with propagation attribute

I developed a spring data jpa program using this tutorial. Then modified it by adding a new class/method to test spring's @Transactional annotation. @Transactional public void txnMethod() { repository.save(new Customer("First Customer","")); …
Jayu Dukii
  • 153
  • 1
  • 6
13
votes
2 answers

How do you test Spring @Transactional without just hitting hibernate level 1 cache or doing manual session flush?

Using Spring + Hibernate and transactional annotations. I'm trying to test the following: call a method that changes a User object then calls a @Transactional service method to persist it read the object back from the DB and insure it's values are…
13
votes
2 answers
13
votes
5 answers

Transactional annotation avoids services being mocked

I have a drools rule file which uses service classes in the rules. So one rule does something like this: eval(countryService.getCountryById(1) != null) In a validationservice that is annotated with @service and…
Michael
  • 233
  • 2
  • 4
  • 11
13
votes
3 answers

Spring @Transactional does not work in JUnit test?

I am using Spring 3.2, Hibernate and JUnit 4. My Dao class is as follows: @Transactional public class SomeDaoImpl implements SomeDao { The update operations on this work if executed directly from web application. However, I am seeing that junit…
Nilesh
  • 4,137
  • 6
  • 39
  • 53
12
votes
3 answers

Transactionally writing files in Node.js

I have a Node.js application that stores some configuration data in a file. If you change some settings, the configuration file is written to disk. At the moment, I am using a simple fs.writeFile. Now my question is: What happens when Node.js…
Golo Roden
  • 140,679
  • 96
  • 298
  • 425
1
2
3
51 52