使用alter table的Spring Jdbc原子性(Spring Jdbc atomicity with alter table)
我正在尝试使用Spring Jdbc编写等效的Rails数据模型演化/回滚机制。
Spring Jdbc transactionnal
insert/replace
工作得很好(在InnoDB mysql 5下使用PROPAGATION_REQUIRED的DataSourceTransactionManager):// Transaction begins getJdbcTemplate().execute("replace into aTable ..."); getJdbcTemplate().execute("wrong request"); getJdbcTemplate().execute("replace into aTable ..."); // none are commited
但
alter
不是:// Transaction begins getJdbcTemplate().execute("alter table aTable add column `columnForTest` ..."); getJdbcTemplate().execute("wrong request"); getJdbcTemplate().execute("alter table aTable add column `columnForTest` ..."); // the first alter is commited
有没有办法用
alter
实现原子性(全有或全无行为)?提前致谢
I'm trying to write an equivalent of Rails data model evolution/rollback mechanism using Spring Jdbc.
Spring Jdbc transactionnal
insert/replace
works very well (DataSourceTransactionManager with PROPAGATION_REQUIRED under InnoDB mysql 5) :// Transaction begins getJdbcTemplate().execute("replace into aTable ..."); getJdbcTemplate().execute("wrong request"); getJdbcTemplate().execute("replace into aTable ..."); // none are commited
but
alter
doesn't :// Transaction begins getJdbcTemplate().execute("alter table aTable add column `columnForTest` ..."); getJdbcTemplate().execute("wrong request"); getJdbcTemplate().execute("alter table aTable add column `columnForTest` ..."); // the first alter is commited
Is there a way to achieve atomicity (all-or-none behavior) with
alter
?Thanks in advance
原文:https://stackoverflow.com/questions/3238918
最满意答案
app id和app unit id应该不同。 在你的代码中似乎是一样的
这里是完整的官方说明: https : //firebase.google.com/docs/admob/android/quick-start
app id and app unit id should be different. in your code seems to be same
here is full official description: https://firebase.google.com/docs/admob/android/quick-start
相关问答
更多-
errorcode301是什么意思?[2023-06-17]
errorcode301,直接翻译就是"错误代码301", 因为我不玩这游戏所以你只能自己联系下管理员或什么的,告诉他错误代码就是301,对方就会告诉你到底错误细节是啥了 -
AdMobs导致项目错误(AdMobs causes project error: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode)[2023-08-12]
我解决了问题,问题是因为我在使用google-play-services_lib时尝试添加GoogleAdMobAdsSdk-6.4.1.jar我完成了这个链接中的内容 ,它现在可以正常工作了 I Solved it, The Problem was because I was trying to add GoogleAdMobAdsSdk-6.4.1.jar while using google-play-services_lib I done like what in this link and it ... -
主要是AdMob ErrorCode 0(AdMob ErrorCode 0 mostly)[2022-01-16]
它刚开始工作,我什么都没变。 也许之前构建它有问题吗? 谁知道,感谢所有帮助,虽然家伙。 It just started working, I changed nothing. Maybe there was a problem building it before? Who knows, thanks for all the help though guys. -
等待几个小时,你就会开始收到广告。 如果它是新创建的广告单元ID,则服务器需要一段时间才能在所有实例上进行复制(也称为预热广告单元)。 如果它与添加的测试设备ID一起工作,它将在没有测试设备ID的情况下正常工作。 Just wait for a few hours and you'll start getting the ads. If it is a newly created ad unit id it will take some time for the servers to replicate i ...
-
克服这个障碍的最小努力将是一个静态帮助器/实用程序方法,它使用反射来破解所需错误代码中的插槽。 使用最优秀的Reflector,我看到有一个私有的“errorCode”字段,它只能通过ManagementException中定义的内部ctors设置。 所以:) public static class EncapsulationBreaker { public static ManagementException GetManagementExceptionWithSpecificError ...
-
这个问题是关于安装在我的手机上的自定义ROM。 所以,在代码中没有错误。 Thansk的帮助,并希望这可能有助于未来的人。 The issue was about adaway installed on my phone with a custom rom. So, no error in the code. Thansk for helping, and hope this can be helpful for someone in future.
-
SocketException:ErrorCode与SocketErrorCode(SocketException: ErrorCode vs. SocketErrorCode)[2023-03-10]
是的,它们完全一样。 看一下源代码 : public override int ErrorCode { // // the base class returns the HResult with this property // we need the Win32 Error Code, hence the override. // get { return NativeErrorCode; } } public SocketError So ... -
不得不改为accountNumber: 1111111, 好的,payex的节点解决方案,如果有人想要/需要它然后:) Had to change to accountNumber: 1111111, Ok, node solution for payex if anyone wants/needs it then :)
-
在IBM页面上搜索错误: http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.db2z10.doc.java%2Fsrc%2Ftpc%2Fimjcc_rjvjcsqc.htm - 4229消息文本:text-from-getMessage说明:批处理执行期间发生错误。 用户响应:调用SQLException.getMessage以检索有关该问题的特定信息。 因此,它可能与执行批量插入/更新/删除期 ...
-
Admob给我ErrorCode:1(Admob giving me ErrorCode: 1)[2022-06-29]
app id和app unit id应该不同。 在你的代码中似乎是一样的 这里是完整的官方说明: https : //firebase.google.com/docs/admob/android/quick-start app id and app unit id should be different. in your code seems to be same here is full official description: https://firebase.google.com/docs/admo ...