Class: DataObjects::SavePoint
- Inherits:
-
Transaction
- Object
- Transaction
- DataObjects::SavePoint
- Defined in:
- lib/data_objects/transaction.rb
Overview
class Transaction
Constant Summary
Constants inherited from Transaction
Instance Attribute Summary
Attributes inherited from Transaction
Class Method Summary collapse
-
.create_for_uri(uri, connection) ⇒ Object
We don’t bounce through DO::<Adapter/scheme>::SavePoint because there doesn’t appear to be any custom SQL to support this.
Instance Method Summary collapse
Methods inherited from Transaction
#begin_prepared, #close, #commit_prepared, #initialize, #prepare, #rollback_prepared
Constructor Details
This class inherits a constructor from DataObjects::Transaction
Class Method Details
.create_for_uri(uri, connection) ⇒ Object
We don’t bounce through DO::<Adapter/scheme>::SavePoint because there doesn’t appear to be any custom SQL to support this.
70 71 72 73 |
# File 'lib/data_objects/transaction.rb', line 70 def self.create_for_uri(uri, connection) uri = uri.is_a?(String) ? URI::parse(uri) : uri DataObjects::SavePoint.new(uri, connection) end |
Instance Method Details
#begin ⇒ Object
75 76 77 |
# File 'lib/data_objects/transaction.rb', line 75 def begin run %{SAVEPOINT "#{@id}"} end |
#commit ⇒ Object
79 80 81 |
# File 'lib/data_objects/transaction.rb', line 79 def commit run %{RELEASE SAVEPOINT "#{@id}"} end |
#rollback ⇒ Object
83 84 85 |
# File 'lib/data_objects/transaction.rb', line 83 def rollback run %{ROLLBACK TO SAVEPOINT "#{@id}"} end |