transactions

Executing an SQLCommand without specifying a Transaction

时间秒杀一切 提交于 2019-12-22 05:54:24
问题 We have some lists of data being fetched in our application via a SqlCommand performing a SELECT query on a SQL Server database. We do not explicitly setup a transaction on the SqlCommand, instead just passing it a SqlConnection and running it. Is it the case that when no transaction is specified that SQL Server will initiate and use a default transaction with the default IsolationLevel of ReadCommitted ? 回答1: SQL Server can work happily without an explicit transaction. But yes, I believe it

Transaction and sending an email

半腔热情 提交于 2019-12-22 05:53:31
问题 Considering the common use case of a user creating a new account on a web application and the application sending a confirmation email to the user's address. From what I've seen, this is typically implemented in one of 3 ways: The web controller calls a service method, which creates the user account and sends the email, both within a single transaction. The web controller calls a service method (with tx propagation = never), which invokes a 1st method on itself to create the user account

Febelfin CODA (Coded Statement of Account) 2.3 Only used in Belgium?

徘徊边缘 提交于 2019-12-22 05:47:07
问题 I'm tasked with writing some code that interprets CODA files that come from (different) (Belgian) banks. CODA files stands for Coded Statement of Account files, and seems to be the Belgian name for textual files that have a line for each bank transaction that occured on a specific bank account. This includes SEPA Direct Debit transaction information. The first 2 banks we are working with are Belgian (Fortis and ING) , and I received the specification of how these files are encoded from each

@Transactional annotation

余生颓废 提交于 2019-12-22 05:23:13
问题 is there any difference between: add "@Transactional" annotation to whole class add for every single method "@Transactional" annotation ? Using spring and Hibernate ? 回答1: Basically, if you annotate the class with @Transactional all methods will be transactional. If you don't, you can annnotate as @Transactional only those methods you want to. Additionally, you can specify different attributes for each method, like isolation , propagation , timeout , ... Also, take a look at this question,

Grails integration tests and transactions

我怕爱的太早我们不能终老 提交于 2019-12-22 05:17:17
问题 I don't get why this integration test fails. I can get the test to pass by either removing the @Transactional(propagation = Propagation.REQUIRES_NEW) annotation above the service method, OR by setting transactional = false in the Integration Test I realize that the integration test itself is running in a transaction, and that's why I've got the annotation on the service method. class DbTests extends GrailsUnitTestCase { boolean transactional = true def customerService void

Getting an ID inside a PostgreSQL transaction block

耗尽温柔 提交于 2019-12-22 05:01:22
问题 I'm trying to wrap all my transactions that should be all-or-nothing into BEGIN and COMMIT , but I'm not sure how to do this in cases like the following. I have 3 tables, one for images, one for albums , and one for the relations between them, namely album_images . The way the system works is that a user can create an album and fill it with his images in one operation. The SQL is as follows: BEGIN; INSERT INTO albums [...]; -- Create a new album row SELECT id AS album_id FROM albums WHERE [..

Lock wait timeout exceeded; try restarting transaction using JDBC

╄→尐↘猪︶ㄣ 提交于 2019-12-22 04:46:18
问题 I have a MySQL table named Student with two columns Student_id and name . I am firing two queries using two connection objects, and it is giving me an Exception: Exception in thread "main" java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006) at com.mysql.jdbc.MysqlIO.sendCommand

Nested Transactions in .NET

主宰稳场 提交于 2019-12-22 04:46:12
问题 How can I perform the equivalent of this? My understanding is that this is impossible with TransactionScopes but I'd like to accomplish the equivalent in some other way: Business Logic class: public bool Bar() { try { using (var tsWork = new TransactionScope()) { ComplicatedDataImportCode(somedata); FlagRecordInDatabaseAsImported(); // this is the same record that's modified in the catch tsWork.Complete(); return true; } catch (DuplicateDataException err) { // if we got here, the above

Uncaught InvalidStateError: Failed to execute 'transaction' on 'IDBDatabase': A version change transaction is running

淺唱寂寞╮ 提交于 2019-12-22 04:42:47
问题 i must admit that i am very new to indexedDB I wrote a simple code of indexedDB and it is as followed: function go(){var req = window.indexedDB.open("Uploader", 1), db; req.onerror=function(e){console.log('Error')}; req.onsuccess = function(e){db=e.target.result;}; req.onupgradeneeded = function(e){console.log(db); db=e.target.result;db=e.target.result; var os = db.createObjectStore('Files', {keyPath:"files"}); os.createIndex('text', 'text_file', {unique:false}) var trans = db.transaction([

Upgrading transaction.commit_manually() to Django > 1.6

*爱你&永不变心* 提交于 2019-12-22 04:42:36
问题 I have inherited some code for an app that was written for Django 1.4. We need to update the codebase to work with Django 1.7, and eventually 1.8 as the next Long Term Support release. In a few places it uses the old style @transaction.commit_manually and with transaction.commit_manually: I do not know enough about transactions in general but I am trying to understand what they are used for, so I can either remove them (if unnecessary) or upgrade them to the newer set_autocommit(False) or