rollback

NHibernate 3 session state after rollback()

心已入冬 提交于 2019-12-01 05:16:06
I have a problem. using (var tran = repository.Session.BeginTransaction()) { try { repository.Save(entity); tran.Comit(); } catch(Exception) { tran.Rollback(); throw; } } using (var tran = repository.Session.BeginTransaction()) { try { repository.GetById(id); tran.Comit(); } catch(Exception) { tran.Rollback(); throw; } } When I try to get an entity by ID after exception and tran.rollback() in the first using block, I get an update exception. So NHibernate is trying to update the entity from the first using block in the second using block. Why? I did the tran.Rollback() . Must I do Session

NHibernate 3 session state after rollback()

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 03:21:49
问题 I have a problem. using (var tran = repository.Session.BeginTransaction()) { try { repository.Save(entity); tran.Comit(); } catch(Exception) { tran.Rollback(); throw; } } using (var tran = repository.Session.BeginTransaction()) { try { repository.GetById(id); tran.Comit(); } catch(Exception) { tran.Rollback(); throw; } } When I try to get an entity by ID after exception and tran.rollback() in the first using block, I get an update exception. So NHibernate is trying to update the entity from

No rollback for ConstraintViolationException in transactional service

梦想与她 提交于 2019-11-30 18:20:32
问题 I've a service method called add() which is annotated with @Transactional . I call it but when a ConstraintViolationException occurs inside corresponding DAO method it'll rollback the transaction even when I specify not to. I expect that ConstraintViolationException to be caught and instead of it NotFoundException checked exception would be thrown. @Override @Transactional(noRollbackFor = ConstraintViolationException.class) public User add(User user) throws NotFoundException { try { result =

is there a reason why Magento shouldn't support uninstall/downgrade for modules

北战南征 提交于 2019-11-30 16:12:03
Automated instant rollback is an important feature of enterprise-grade deployment mechanisms. Currently, it's not possible to achieve this using Magento's built-in installation tools. Given that Magento's core_resource mechanism allows for the sequential execution of setup scripts for installation or upgrade of modules (via execution of SQL and also PHP), it seems logical IMHO that it should support the same process in reverse. Now, some obvious reasons not to support it: It would be challenging for the rollback scripts to be independent (and possibly idempotent?). I don't see this to be a

Hibernate persist failure with PostGIS Geometry

五迷三道 提交于 2019-11-30 14:06:32
问题 Related to previous question. I have a Spring Roo application using Hibernate to write a Geometry object to a PostGIS database using JTS. I believe I've fixed the problems I had in defining my Geometry object, and now Hibernate is executing its persist() method, but something is going wrong just before it hits the DB and I'm getting the exception below. Here are some interesting lines. First from the Hibernate logs, the object to be persisted, and then an SQL query (presumably the ? are

Entity Framework rollback and remove bad migration

限于喜欢 提交于 2019-11-30 10:13:40
问题 I'm using EF 6.0 for my project in C# with manual migrations and updates. I have about 5 migrations on the database, but I realised that the last migration was bad and I don't want it. I know that I can rollback to a previous migration, but when I add a new (fixed) migration and run Update-Database, even the bad migration is applied. I was trying to rollback to the previous migration and delete the file with bad migration. But then, when I try to add new migration, I get error when updating

PHP & mySQL: Simple code to implement Transaction - Commit & Rollback

北慕城南 提交于 2019-11-30 10:08:45
MY PLATFORM: PHP & mySQL MY SITUATION: I am trying to implement transactions within my code. I tried to follow examples, but it's not much help. I am running 3 queries and I wanted to write a transaction in such a way so that if any of the query(ies) fail, the whole transaction should roll back. I would really appreciate a simple, efficient and non-object oriented PHP code to achieve this goal. Thank you in advance. MY PHP CODE: //db_res calls a custom function that performs a mysql_query on the query $res1 = db_res("SELECT c1, c2 FROM t1 WHERE c5 = 3"); $res2 = db_res("UPDATE t2 SET c1 = 5

Mysql transaction : commit and rollback

南笙酒味 提交于 2019-11-30 10:05:52
I updated my PhpMyAdmin database engine from MyISAM to INNODB to allow rollback. This is my SQL query : START TRANSACTION; UPDATE jkm_content SET state=0 WHERE title IN ('title-1','title2'); And the result : start transaction;# MySQL returned an empty result set (i.e. zero rows). UPDATE jkm_content SET state=1 WHERE title IN ('title-1','title2');# 2 rows affected. 1) So the statement informs me that 2 rows are affected but the change doesn't appear anywhere (neither in my DB nor in the website).I though start transaction would allow me to visualize the changes (in a temporary DB) and then if I

Is there any way to recover recently deleted documents in MongoDB?

久未见 提交于 2019-11-30 00:23:27
I have removed some documents in my last query by mistake, Is there any way to rollback my last query mongo collection. Here it is my last query : db.datas.remove({ "name" : "some_x_name"}) Is there any rollback/undo option? Can I get my data back? There is no rollback option ( rollback has a different meaning in a MongoDB context), and strictly speaking there is no supported way to get these documents back - the precautions you can/should take are covered in the comments. With that said however, if you are running a replica set, even a single node replica set, then you have an oplog . With an

PHP & mySQL: Simple code to implement Transaction - Commit & Rollback

强颜欢笑 提交于 2019-11-29 14:45:38
问题 MY PLATFORM: PHP & mySQL MY SITUATION: I am trying to implement transactions within my code. I tried to follow examples, but it's not much help. I am running 3 queries and I wanted to write a transaction in such a way so that if any of the query(ies) fail, the whole transaction should roll back. I would really appreciate a simple, efficient and non-object oriented PHP code to achieve this goal. Thank you in advance. MY PHP CODE: //db_res calls a custom function that performs a mysql_query on