数据库事务是一个熟悉的概念.
try {
...
..
updateDB()
..
...
commit();
} catch error {
rollback();
}
Run Code Online (Sandbox Code Playgroud)
如果发生任何错误,则将丢弃updateDB所做的任何更改.
我想知道消息队列事务回滚将撤消什么.
try{
...
...
//EDIT: swapped the order of receive and send
Message m = queue1.receiveMessage(..)
..
..
queue2.sendMessage(..)
..
..
commit();
} catch error {
rollback();
}
Run Code Online (Sandbox Code Playgroud)
具体来说,回滚会做什么
或者我是将数据库tx拉得太过分了.
谢谢
编辑:我并不是暗示发送和接收操作是相关的.我只是想说有两个操作可以改变消息代理的状态 - 接收将从队列中取出一条消息,如果有的话,它将对其他消费者不可用.
在grails中,resources.groovy
使用spring groovy DSL 定义了spring bean
beans = {
myBean(MyBeanImpl) {
someProperty = 42
otherProperty = "blue"
bookService = ref("bookService")
}
}
Run Code Online (Sandbox Code Playgroud)
代码段:
<LinearLayout
android:id="@+id/fullscreen_content_controls"
style="?buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:background="@color/black_overlay"
android:orientation="horizontal"
tools:ignore="UselessParent" >
<Button
android:id="@+id/dummy_button"
style="?buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dummy_button" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
我不确定tools:ignore="UselessParent"
手段.这是否意味着当lint发现Button填充时LinearLayout
,然后LinearLayout
将删除,Button将移动到父级并让视图层次结构高效?非常感谢!