transactions

Transactions With JSONCollection instead of BSONCollection

社会主义新天地 提交于 2020-08-10 18:57:05
问题 I have a problem to make Transaction via JSONCollection, I getting the following error: JsResultException(errors:List((,List(JsonValidationError(List(CommandError[code=14, errmsg=BSON field 'OperationSessionInfo.txnNumber' is the wrong type 'int', expected type 'long', doc: {"operationTime":{"$time":1596894245,"$i":5,"$timestamp":{"t":1596894245,"i":5}},"ok":0,"errmsg":"BSON field 'OperationSessionInfo.txnNumber' is the wrong type 'int', expected type 'long'","code":14,"codeName":

@Transactional on controller method not working

余生长醉 提交于 2020-08-09 06:57:44
问题 In my Spring MVC application, I have a method in a controller that needs to save a bunch of objects (built from an uploaded file) to a database. Let us leave aside for the moment the whole question about whether transactions should be done in the controller or service layer -- the point is that it should technically be feasible to do it in the controller, but I am finding problems. If you look at the code below, what I am expecting is that if any of the three calls to saveContact fails with

@Transactional on controller method not working

淺唱寂寞╮ 提交于 2020-08-09 06:55:59
问题 In my Spring MVC application, I have a method in a controller that needs to save a bunch of objects (built from an uploaded file) to a database. Let us leave aside for the moment the whole question about whether transactions should be done in the controller or service layer -- the point is that it should technically be feasible to do it in the controller, but I am finding problems. If you look at the code below, what I am expecting is that if any of the three calls to saveContact fails with

@Transactional on controller method not working

烂漫一生 提交于 2020-08-09 06:55:31
问题 In my Spring MVC application, I have a method in a controller that needs to save a bunch of objects (built from an uploaded file) to a database. Let us leave aside for the moment the whole question about whether transactions should be done in the controller or service layer -- the point is that it should technically be feasible to do it in the controller, but I am finding problems. If you look at the code below, what I am expecting is that if any of the three calls to saveContact fails with

MySQL: A deadlock occurred when deleting the same row twice in the (unique) secondary index

假如想象 提交于 2020-08-08 05:27:29
问题 Recently I encountered a deadlock when deleting records (Note that the isolation level is REPEATABLE READ , MySQL 5.7) Here is the repro steps 1 Create a new table CREATE TABLE `t` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(32) NOT NULL, PRIMARY KEY (`id`), KEY `p_name` (`name`) ) ENGINE=InnoDB CHARSET=utf8; 2 Prepare 3 records insert into t (name) value ('A'), ('C'), ('D'); 3 +====================================+============================================================+ |

mysql transaction error handling

穿精又带淫゛_ 提交于 2020-08-02 13:26:19
问题 DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND BEGIN ROLLBACK; END; START TRANSACTION; UPDATE tbl_order SET TransactionID="abc" WHERE OrderID=1; UPDATE tbl_order SET TransactionID="xyz" WHERE OrderID=; UPDATE tbl_order SET TransactionID="zzz" WHERE OrderID=13; COMMIT; for some reason order 1 and 13 are filled without rollback and i get syntax error for the exit hadler. Query: DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND BEGIN ROLLBACK Error Code: 1064 You have an

mysql transaction error handling

大兔子大兔子 提交于 2020-08-02 13:26:18
问题 DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND BEGIN ROLLBACK; END; START TRANSACTION; UPDATE tbl_order SET TransactionID="abc" WHERE OrderID=1; UPDATE tbl_order SET TransactionID="xyz" WHERE OrderID=; UPDATE tbl_order SET TransactionID="zzz" WHERE OrderID=13; COMMIT; for some reason order 1 and 13 are filled without rollback and i get syntax error for the exit hadler. Query: DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND BEGIN ROLLBACK Error Code: 1064 You have an