transactions

Which is better, SQL transaction or Java side transaction for an banking application?

流过昼夜 提交于 2019-12-25 07:07:11
问题 I am making a banking application and not able to decide which will be a better approach to handle fund transfer transactions. Using SQL may need rewritting code if the database changes. Using pure Java to handle will make it little more complex in terms of locking the accounts for the transactions. What is the best practice for this scenario? PS - please consider a distributed application server in this case. 回答1: Any application, that leaves the DB in a possibly inconcistent state on hard

ATG RepositoryItem getPropertyValue, no cache, no transaction

て烟熏妆下的殇ゞ 提交于 2019-12-25 07:03:06
问题 If I have an ATG Nucleus Repository Item that is not cacheable (ATG/Nucleus simple cache is disabled) AND I'm not in a transaction, the following results in two queries to the database. The following code results in a db query for every property. repositoryItem.getPropertyValue("columnA"); repositoryItem.getPropertyValue("columnB"); If debugging for the user entity is enabled you would see the following log statements ever each call: repositoryItem.getPropertyValue("columnA"); DEBUG

ATG RepositoryItem getPropertyValue, no cache, no transaction

喜欢而已 提交于 2019-12-25 07:02:11
问题 If I have an ATG Nucleus Repository Item that is not cacheable (ATG/Nucleus simple cache is disabled) AND I'm not in a transaction, the following results in two queries to the database. The following code results in a db query for every property. repositoryItem.getPropertyValue("columnA"); repositoryItem.getPropertyValue("columnB"); If debugging for the user entity is enabled you would see the following log statements ever each call: repositoryItem.getPropertyValue("columnA"); DEBUG

Can I use SqlBulkCopy inside Transaction

你说的曾经没有我的故事 提交于 2019-12-25 06:53:48
问题 Is it safe to use SqlBulkCopy in a TransactionScope ? I am aware of this question but it does not answer the question and its pretty old. If its not possible what is a good alternative? 回答1: It seems that if the TransactionScope is created before the sql-connection used for the SqlBulkCopy is created and opened the transaction-handling mechanics of the TransactionScope are used. Which means that you manually need to create your own SqlConnection and open it which you later use for the

updating batches of data

一笑奈何 提交于 2019-12-25 06:52:47
问题 I am using GridView in asp .net and editing data with edit command field property (as we know after updating the edited row, we automatically update the database), and I want to use transactions (with begin to commit statement - including rollback) to commit this update query in database, after clicking in some button (after some events for example), not automatically to insert or update the edited data from grid directly to the DB...so I want to save them somewhere temporary (even many

Conditional transaction rollback

↘锁芯ラ 提交于 2019-12-25 05:33:42
问题 I am wondering, if there is a possibility to apply conditional transaction rollback based on state of particular batch. For example, I have a following code: BEGIN TRAN --EXEC No 1 EXEC [dbo].[MyProc] 1; GO --EXEC No 2 EXEC [dbo].[MyProc] 22; GO --EXEC No 3 EXEC [dbo].[MyProc] 333; GO --EXEC No 4 EXEC [dbo].[MyProc] 5; GO COMMIT And I want to rollback entire transaction if the EXEC No 3 fails. If any other execution fails I want SQL Server to continue executing my query. Is it possible? 回答1:

Nested transactions on google app engine datastore 3

丶灬走出姿态 提交于 2019-12-25 05:19:09
问题 Question is: does ds.put(employee) happen in transaction? Or does the outer transaction get erased/overriden by the transaction in saveRecord(..)? Once error is thrown at line datastore.put(..) at some point in the for-loop (let's say i==5), will previous puts originating on the same line get rollbacked? What about puts happening in the saveRecord(..). I suppose those will not get rollbacked. DatastoreService datastore = DatastoreServiceFactory.getDatastoreService() Transaction txn =

Nested transactions on google app engine datastore 3

ぃ、小莉子 提交于 2019-12-25 05:19:05
问题 Question is: does ds.put(employee) happen in transaction? Or does the outer transaction get erased/overriden by the transaction in saveRecord(..)? Once error is thrown at line datastore.put(..) at some point in the for-loop (let's say i==5), will previous puts originating on the same line get rollbacked? What about puts happening in the saveRecord(..). I suppose those will not get rollbacked. DatastoreService datastore = DatastoreServiceFactory.getDatastoreService() Transaction txn =

Does LINQ2SQL automatically put ExecuteCommand in a transaction

久未见 提交于 2019-12-25 05:13:52
问题 Does the documentation quotation from this answer: https://stackoverflow.com/a/542691/1011724 When you call SubmitChanges, LINQ to SQL checks to see whether the call is in the scope of a Transaction or if the Transaction property (IDbTransaction) is set to a user-started local transaction. If it finds neither transaction, LINQ to SQL starts a local transaction (IDbTransaction) and uses it to execute the generated SQL commands. When all SQL commands have been successfully completed, LINQ to

connection pooling: retrieve lost DB connection

做~自己de王妃 提交于 2019-12-25 05:12:04
问题 I am implementing 2-phase commit for a distributed transaction(using 2 Databases). I simulate a DB server connection loss by pulling the network cable to my desk Computer and then plugging it back. However, this causes the transaction to fail in executing a "rollback" as the DB connection object is lost. Is there a way that i can retrieve the lost DB connection object or enforce the application to try reconnect to the same connection after a certain timeperiod. I am using DB2 and Websphere 6