Class: DataObjects::Postgres::Transaction
- Inherits:
-
Transaction
- Object
- Transaction
- DataObjects::Postgres::Transaction
- Defined in:
- lib/do_postgres/transaction.rb
Instance Method Summary collapse
- #begin ⇒ Object
- #begin_prepared ⇒ Object
- #commit ⇒ Object
- #commit_prepared ⇒ Object
- #prepare ⇒ Object
- #rollback ⇒ Object
- #rollback_prepared ⇒ Object
Instance Method Details
#begin ⇒ Object
8 9 10 11 |
# File 'lib/do_postgres/transaction.rb', line 8 def begin cmd = "BEGIN" connection.create_command(cmd).execute_non_query end |
#begin_prepared ⇒ Object
13 14 15 16 |
# File 'lib/do_postgres/transaction.rb', line 13 def begin_prepared cmd = "BEGIN" connection.create_command(cmd).execute_non_query end |
#commit ⇒ Object
18 19 20 21 |
# File 'lib/do_postgres/transaction.rb', line 18 def commit cmd = "COMMIT" connection.create_command(cmd).execute_non_query end |
#commit_prepared ⇒ Object
23 24 25 26 |
# File 'lib/do_postgres/transaction.rb', line 23 def commit_prepared cmd = "COMMIT PREPARED '#{id}'" connection.create_command(cmd).execute_non_query end |
#prepare ⇒ Object
38 39 40 41 |
# File 'lib/do_postgres/transaction.rb', line 38 def prepare cmd = "PREPARE TRANSACTION '#{id}'" connection.create_command(cmd).execute_non_query end |
#rollback ⇒ Object
28 29 30 31 |
# File 'lib/do_postgres/transaction.rb', line 28 def rollback cmd = "ROLLBACK" connection.create_command(cmd).execute_non_query end |
#rollback_prepared ⇒ Object
33 34 35 36 |
# File 'lib/do_postgres/transaction.rb', line 33 def rollback_prepared cmd = "ROLLBACK PREPARED '#{id}'" connection.create_command(cmd).execute_non_query end |