forked from dlang/cdcdb
		
	Удаление снимка с транзакцией
This commit is contained in:
		
							parent
							
								
									e42aacbed7
								
							
						
					
					
						commit
						e8f29b6130
					
				
					 1 changed files with 16 additions and 0 deletions
				
			
		| 
						 | 
					@ -159,7 +159,23 @@ public:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void removeSnapshot(const ref Snapshot snapshot)
 | 
						void removeSnapshot(const ref Snapshot snapshot)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
 | 
							_db.beginImmediate();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							bool ok;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							scope (exit)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								if (!ok)
 | 
				
			||||||
 | 
									_db.rollback();
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							scope (success)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								_db.commit();
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		_db.deleteSnapshot(snapshot.id);
 | 
							_db.deleteSnapshot(snapshot.id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							ok = true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	string getVersion() {
 | 
						string getVersion() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue