系统崩溃后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
最满意答案
我想你自己给出了答案。
focus
和blur
是要用于此的事件,它们并非专门用于输入元素,您可以在此处看到[1]。 我甚至在图层用例中手动触发focus
事件:图层打开,我想捕获ESC
的按键以关闭图层。 为此,我需要将焦点设置在图层上,否则我的事件处理程序不会触发。要捕获外部的单击,您只需要在跨越整个屏幕的元素上注册
pointerUp
或click
事件(它必须真正覆盖整个屏幕,如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
andblur
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 thefocus
event manually in a layer use case: A layer opens and I want to capture the keypress ofESC
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
orclick
events on an element that spans the whole screen (it must really cover the whole screen like thebody
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 ...
-
轻扫客人查看桌面视图(swipe guesture for tableview)[2022-02-01]
当您使用多个手势识别器时,您需要实现手势识别器的以下委托方法,以使它们同时工作 - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer 分别你需要返回YES When you use more then one gesture recog ... -
使用NSFetchedResultsController轻扫以删除表格中的单元格(Swipe to Delete a Cell in a Table using NSFetchedResultsController)[2021-07-30]
要从表中删除行,您只需删除相应的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: ...