transactions

Hibernate and TransactionRequiredException when propagation set to Propagation.NOT_SUPPORTED

百般思念 提交于 2019-12-23 16:20:03
问题 TL;DR: Service method annotated with @Transactional(propagation = Propagation.NOT_SUPPORTED) Hibernate 5.0.4.Final: everything works as expected (method is executed without transaction) Hibernate 5.2.5.Final: javax.persistence.TransactionRequiredException: no transaction is in progress is thrown as a testcase for this issue I created a simple maven web app and the only change made in code (copy-paste from old working project) was Hibernate version bump in pom.xml Question: What is the proper

firebase Cloud function transaction working sporadically

一笑奈何 提交于 2019-12-23 16:12:03
问题 I have the cloud function like so: exports.updateNewsCount = functions.database.ref('/channels/{channelId}/news/{newsId}/') .onWrite (event => { const channelId = event.params.channelId; const newsId = event.params.newsId; let CntRef = admin.database().ref('/channelDetails/' + channelId + '/newsCnt'); if (event.data.exists() && !event.data.previous.exists()){ return CntRef.transaction(function(current){ if (current){ console.log ('current is not null'); return (current || 0) + 1; } else {

Django test case db giving inconsistent responses, caching or transaction culprit?

与世无争的帅哥 提交于 2019-12-23 15:05:19
问题 I am seeing some really surprising and frustrating behavior with Django testing. Model objects are being "found" by a related lookup, but no model objects exist. (I apologize for the weird description here...the behavior is bizarre enough that I don't know quite how to describe it. Do the objects exist? Do I exist? Do you??) I need them to exist, so I have a method in place that creates them if they don't exist. The problem is that on one line, Django finds that they do exist, and therefore

Controlling inner transaction settings from outer transaction with Spring 2.5

时间秒杀一切 提交于 2019-12-23 13:19:11
问题 I'm using Spring 2.5 transaction management and I have the following set-up: Bean1 @Transactional(noRollbackFor = { Exception.class }) public void execute() { try { bean2.execute(); } catch (Exception e) { // persist failure in database (so the transaction shouldn't fail) // the exception is not re-thrown } } Bean2 @Transactional public void execute() { // do something which throws a RuntimeException } The failure is never persisted into DB from Bean1 because the whole transaction is rolled

maxTimeout value from Machine.Config is not picked up by C# winform app

China☆狼群 提交于 2019-12-23 13:11:17
问题 I have been working on a winform app with Oracle 10g database which is using TransactionScope and wanted to modify the maxTimeOut value specified in machine.config file, my machine.config file is in the following location (I am using .net 4 for this app) C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config Originally there was not anything specified for maxTimeOut in it, therefore it defaults to 10 minutes. In order to change it I have added the maxTimeout="00:00:10" value as seen below:

JPA transaction rollback fails with call to stateless bean

眉间皱痕 提交于 2019-12-23 12:54:40
问题 Inside a BMT (using a UserTransaction ) I call a method on another stateless EJB. When I rollback this transaction, the entity created in the EJB method is not rolled back. I use EJB 3.1 with JPA 2.0. The transaction begins in method doTheTransaction() : @Stateless @LocalBean @TransactionManagement(TransactionManagementType.BEAN) public class TaskExecutor { @Inject private SomeEntityFacade someEntityEJB; @Inject private RandomEJB randomEJB; @Resource private UserTransaction ut; @Asynchronous

Why does not SELECT query start the transaction? [Oracle]

点点圈 提交于 2019-12-23 12:06:30
问题 I am trying to debug next oracle procedure: create or replace PROCEDURE CASE_6_TRANS_2 AS V_NUM NUMBER(38,0); BEGIN SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; SELECT COUNT(AE.ID) INTO V_NUM FROM AUDIT_EVENT AE WHERE ID=10; COMMIT; --BREAKPOINT END CASE_6_TRANS_2; But when I want to see current transaction at breakpoint , the V$TRANSACTION table is empty. The documentation says: A transaction begins when the first executable SQL statement is encountered. An executable SQL statement is a SQL

Exception handling around the rollback of a SqlTransaction

倾然丶 夕夏残阳落幕 提交于 2019-12-23 12:06:14
问题 I have two stored procedures that I want execute wrapped in a transaction. For various reasons, I need to handle the transaction in my application code instead of within the database. At the moment, my code looks like this: try { using (SqlConnection conn = Connection()) { conn.Open(); using (SqlTransaction sqlTrans = conn.BeginTransaction()) { try { using (SqlCommand cmd1 = new SqlCommand("Stored_Proc_1", conn, sqlTrans)) { cmd1.CommandType = CommandType.StoredProcedure; cmd1.ExecuteNonQuery

Why does not SELECT query start the transaction? [Oracle]

浪子不回头ぞ 提交于 2019-12-23 12:05:50
问题 I am trying to debug next oracle procedure: create or replace PROCEDURE CASE_6_TRANS_2 AS V_NUM NUMBER(38,0); BEGIN SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; SELECT COUNT(AE.ID) INTO V_NUM FROM AUDIT_EVENT AE WHERE ID=10; COMMIT; --BREAKPOINT END CASE_6_TRANS_2; But when I want to see current transaction at breakpoint , the V$TRANSACTION table is empty. The documentation says: A transaction begins when the first executable SQL statement is encountered. An executable SQL statement is a SQL

TransactionScope/SqlTransaction timeout extension

做~自己de王妃 提交于 2019-12-23 11:54:40
问题 Is it possible to extend the timeout of a transaction (with SQL Server) once the transaction has started? 回答1: The timeout is "external" to SQL Server, so SQL Server can not affect it. So "no" unfortunately 回答2: I doubt it, but you could rollback and retry. 来源: https://stackoverflow.com/questions/4723944/transactionscope-sqltransaction-timeout-extension