首页 \ 问答 \ 系统崩溃后mysql事务会回滚吗?(Will mysql transactions rollback after system crash?)

系统崩溃后mysql事务会回滚吗?(Will mysql transactions rollback after system crash?)

我的问题是:如果系统在执行mysql事务时崩溃,系统重启后事务是否会回滚?

mysql如何执行事务?

MySQL会在重启后检查未完成的事务吗?

我问这个是因为我在php中创建了一个事务系统,但是我没有将最终结果存储在任何地方以便在系统崩溃的情况下进行未来的回滚...


My question baliscally is: if the sytem crashes right when a mysql transaction is executed, will the transaction rollback after system restart?

How are the transactions executed by mysql?

Will MySQL check for unfinished transactions after restart?

I'm asking this because I made a transaction system in php, but I'm not storing the final results anywhere for a future rollback in case of a system crash...


原文:https://stackoverflow.com/questions/8352870
更新时间:2023-05-03 10:05

最满意答案

我想你自己给出了答案。 focusblur是要用于此的事件,它们并非专门用于输入元素,您可以在此处看到[1]。 我甚至在图层用例中手动触发focus事件:图层打开,我想捕获ESC的按键以关闭图层。 为此,我需要将焦点设置在图层上,否则我的事件处理程序不会触发。

要捕获外部的单击,您只需要在跨越整个屏幕的元素上注册pointerUpclick事件(它必须真正覆盖整个屏幕,如body元素)。 由于事件冒泡,只要没有其他任何捕获并取消它,处理程序就会触发。

[1] https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#event-type-blur


I think you gave the answer yourself. focus and blur are the events to be used for this and they are not exclusively meant for input elements, as you can see here [1]. I'm even trigger the focus event manually in a layer use case: A layer opens and I want to capture the keypress of ESC to close the layer. For this I need to set the focus on the layer as my event handler would not fire otherwise.

To capture the click outside you just need to register for pointerUp or click events on an element that spans the whole screen (it must really cover the whole screen like the body element). Because of the event bubbling the handler will fire as long as nothing else captured and cancelled it.

[1] https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#event-type-blur

相关问答

更多
  • 尝试重新加载后删除,在这行之后[self.tableView endUpdates]; 我认为你从messageArray中删除了数据,但是因为你不在之后重新加载,所以表视图计数仍然是2,并且你正在重新加载块,这可能需要花费时间。 还有一件事你已经从messageArray中删除数据,然后从数据库中删除,所以如果你不能从数据库中删除它,你显示它没有被删除,但是对于用户它将被删除,因为它不再在消息数组中 Try reloading after you delete, after this line [self ...
  • 您可以使用类变量来存储滑动发生的次数,并采取相应的措施。 private int swipeCounter = 0; @Override public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: x1 = event.getX(); break; case Mot ...
  • 我想你自己给出了答案。 focus和blur是要用于此的事件,它们并非专门用于输入元素,您可以在此处看到[1]。 我甚至在图层用例中手动触发focus事件:图层打开,我想捕获ESC的按键以关闭图层。 为此,我需要将焦点设置在图层上,否则我的事件处理程序不会触发。 要捕获外部的单击,您只需要在跨越整个屏幕的元素上注册pointerUp或click事件(它必须真正覆盖整个屏幕,如body元素)。 由于事件冒泡,只要没有其他任何捕获并取消它,处理程序就会触发。 [1] https://dvcs.w3.org/hg ...
  • 找到了解决方案。 我使用UISwipeGestureRecogniser在UIWebview和WKWebview上委托了一个滑动操作,然后我创建了处理这些操作的函数。 尽管此代码特定于此框架,但它可能与某人有关。 我的代码如下: -(void) viewDidLoad{ [super viewDidLoad]; UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:sel ...
  • 最有可能的是,你的问题与焦点有关。 为了使您的代码正常工作,您附加SWIPE侦听器的对象必须具有当前焦点才能接收事件。 如果它们在屏幕外或用户在滑动之前未触摸它们,则它们将不会发送事件。 尝试将您的听众添加到stage ,这样无论滑动开始的位置,事件总是会触发。 //Global Swipe stage.addEventListener(TransformGestureEvent.GESTURE_SWIPE, onSwipe); 要滑动菜单,使用补间库(例如TweenLite )时非常容易 import ...
  • setAction之后,你忘记了调用.show(),所以你的代码将如下所示: Snackbar.make(layout, "Subscription Deleted", Snackbar.LENGTH_LONG) .setAction("Undo", { _ -> activeSubs.add(position-1, tmp) ...
  • 关于什么... if (downYValue < currentY) { Log.d(DEBUG_TAG, "Down"); } 你确定你写了上面的代码吗? 编辑 好的,我相信你。 你要做的基本上是: double sizeInX = Math.abs(downXValue - currentX); double sizeInY = Math.abs(downYValue - currentY); if( sizeInX > sizeInY ){ // you better swipe ho ...
  • 当您使用多个手势识别器时,您需要实现手势识别器的以下委托方法,以使它们同时工作 - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer 分别你需要返回YES When you use more then one gesture recog ...
  • 要从表中删除行,您只需删除相应的Core Data对象: if (editingStyle == UITableViewCellEditingStyleDelete) { [self.managedObjectContext deleteObject:[self.fetchedResultsController objectAtIndexPath:indexPath]]; NSError *error = nil; if (![self.managedObjectContext s ...
  • 使用OnTouchListener: private float baseX, baseY; OnTouchListener listener = new OnTouchListener(){ public boolean onTouch (View v, MotionEvent event) { switch(event.getAction()) { case MotionEvent.ACTION_DOWN: ...

相关文章

更多

最新问答

更多
  • sp_updatestats是否导致SQL Server 2005中无法访问表?(Does sp_updatestats cause tables to be inaccessible in SQL Server 2005?)
  • 如何创建一个可以与持续运行的服务交互的CLI,类似于MySQL的shell?(How to create a CLI that can interact with a continuously running service, similar to MySQL's shell?)
  • AESGCM解密失败的MAC(AESGCM decryption failing with MAC)
  • Zurb Foundation 4 - 嵌套网格对齐问题(Zurb Foundation 4 - Nested grid alignment issues)
  • 湖北京山哪里有修平板计算机的
  • SimplePie问题(SimplePie Problem)
  • 在不同的任务中,我们可以同时使用多少“上下文”?(How many 'context' we can use at a time simultaneously in different tasks?)
  • HTML / Javascript:从子目录启用文件夹访问(HTML/Javascript: Enabling folder access from a subdirectory)
  • 为什么我会收到链接错误?(Why do I get a linker error?)
  • 如何正确定义析构函数(How to properly define destructor)
  • 垂直切换菜单打开第3级父级。(Vertical toggle menu 3rd level parent stay opened. jQuery)
  • 类型不匹配 - JavaScript(Type mismatch - JavaScript)
  • 为什么当我将模型传递给我的.Net MVC 4控制器操作时,它坚持在部分更新中使用它?(Why is it that when I pass a Model to my .Net MVC 4 Controller Action it insists on using it in the Partial Update?)
  • 在使用熊猫和statsmodels时拉取变量名称(Pulling variable names when using pandas and statsmodels)
  • 如何开启mysql计划事件
  • 检查数组的总和是否大于最大数,反之亦然javascript(checking if sum of array is greater than max number and vice versa javascript)
  • 使用OpenGL ES绘制轮廓(Drawing Outline with OpenGL ES)
  • java日历格式(java Calendar format)
  • Python PANDAS:将pandas / numpy转换为dask数据框/数组(Python PANDAS: Converting from pandas/numpy to dask dataframe/array)
  • 如何搜索附加在elasticsearch索引中的文档的内容(How to search a content of a document attached in elasticsearch index)
  • LinQ to Entities:做相反的查询(LinQ to Entities: Doing the opposite query)
  • 从ExtJs 4.1商店中删除记录时会触发哪些事件(Which events get fired when a record is removed from ExtJs 4.1 store)
  • 运行javascript后如何截取网页截图[关闭](How to take screenshot of a webpage after running javascript [closed])
  • 如何使用GlassFish打印完整的堆栈跟踪?(How can I print the full stack trace with GlassFish?)
  • 如何获取某个exe应用程序的出站HTTP请求?(how to get the outbound HTTP request of a certain exe application?)
  • 嗨,Android重叠背景片段和膨胀异常(Hi, Android overlapping background fragment and inflate exception)
  • Assimp详细说明typedef(Assimp elaborated type refers to typedef)
  • 初始化继承类中不同对象的列表(initialize list of different objects in inherited class)
  • 使用jquery ajax在gridview行中保存星级评分(Save star rating in a gridview row using jquery ajax)
  • Geoxml3 groundOverlay zIndex(Geoxml3 groundOverlay zIndex)