rollback

Spring Transaction not rolling back

我与影子孤独终老i 提交于 2021-02-18 11:20:10
问题 I have something like this: @Service @Transactional public class ServiceA { @Autowired SomeDAO1 dao1; @Autowired ServiceB serviceB; public void methodServiceA() { serviceB.someMethodThatRunsInsertIntoDB(); dao1.anotherMethodThatRunsInsertIntoDB(); } } @Service @Transactional public class ServiceB { @Autowired Dao2 dao2; public void someMethodThatRunsInsertIntoDB() { dao2.insertXXX(); } } My problem is: if serviceB.someMethodThatRunsInsertIntoDB() executes sucessfully but dao1

@Transactional annotation does not rollback RuntimeException even if @EnableTransactionManagement is provided

旧巷老猫 提交于 2021-02-11 12:54:26
问题 I have the following application setup: @SpringBootApplication @EnableTransactionManagement public class MyApp extends SpringBootServletInitializer { ... } with a class which has the following: public class DoStaff { public void doStaffOnAll(List<MyObject> myObjects) { for (int i=0; i<myObjects.size(); i++) { try { doStaffOnSingle(myObjects.get(i), i); } catch (Exception e) { e.printStrackTrace(); } } } @Transactional public void doStaffOnSingle(MyObject myObject, int i) { repository.save

Capistrano deploy:assets:restore_manifest Rails assets manifest file (or backup file) not found

和自甴很熟 提交于 2020-06-27 07:48:30
问题 TLDR; I have been deploying with Capistrano for over a year and able to rollback and now all of a sudden I cannot rollback saying it cannot find the rake asset file Problem Capistrano Rollback is failing complaining that it cannot find the rake asset manifest which I validated is not there. What creates this and why would it just stop being created? I have been pulling my hair out for days over this and am at a point to figure out how to hack out that portion of the rollback and manually

Autocommit with PDO

£可爱£侵袭症+ 提交于 2020-05-31 04:05:21
问题 The rollback of my transaction doesn't work. How do I set autocommit to false (or 0) in the php script using PDO (I have InnoDB 5.7.18) ? Here is my code: global $bdd; //defined with PDO try { $bdd->beginTransaction(); /* my requests */ $bdd->commit(); } catch (Exception $e) { $bdd->rollBack(); return $e->getMessage(); } return true; } 回答1: $db = new PDO('mysql:dbname=employee'); $db->setAttribute(PDO::ATTR_AUTOCOMMIT,0); var_dump($db->query('SELECT @@autocommit')->fetchAll()); 回答2: I solved

Autocommit with PDO

旧巷老猫 提交于 2020-05-31 04:03:00
问题 The rollback of my transaction doesn't work. How do I set autocommit to false (or 0) in the php script using PDO (I have InnoDB 5.7.18) ? Here is my code: global $bdd; //defined with PDO try { $bdd->beginTransaction(); /* my requests */ $bdd->commit(); } catch (Exception $e) { $bdd->rollBack(); return $e->getMessage(); } return true; } 回答1: $db = new PDO('mysql:dbname=employee'); $db->setAttribute(PDO::ATTR_AUTOCOMMIT,0); var_dump($db->query('SELECT @@autocommit')->fetchAll()); 回答2: I solved

NodeJS - MySQL Transactions not working as expected

ぃ、小莉子 提交于 2020-05-17 06:22:07
问题 I am trying to apply Trasnactions ( beginTransaction , rollback and commit . however if the query of adding invoice (Frst Query) executed successfully I want to update the supplier amount (Second Query). I intended to write wrong syntax in the second query by changing UPDATE to UPDATEEE . I assumed this should rollback . I got query syntax error message but the invoice added (first query successfully executed). What is the wrong thing i am doing? Invoice.addNewInvoice = function (invoice_data

Laravel Dusk, DatabaseTransactions not doing the RollBack

我是研究僧i 提交于 2020-01-25 03:49:12
问题 I'm using Laravel Dusk, the following Register test works fine, except that it doesn't rollBack the transaction (i.e. the user record created on 'Register' always stays in the DB). My tables are all set to use InnoDB engine. Any ideas of what is going on? I have put Logs in many places and nothing looks particularly wrong. I don't get any errors at all in laravel.log file either. use DatabaseTransactions; protected $connectionsToTransact = [ 'mysql' ]; /** * A basic browser test example. * *

Best way to roll back to previous versions without baseline in CC

梦想与她 提交于 2020-01-25 02:24:06
问题 I need to roll back to a previous version of my project, but I haven't really been creating baselines. Whats the best way to do this. I think I have a large clearfsimport operation that marks the current version that my desired view would pre-date. What is the best way to create a view like this. I was hoping I could do something based on date that would just create a view that includes all versions from Date X and before, or perhaps Activity X and before. I do have a large number of files