Transaction in boto3 dynamoDb Python2.7

By Umair

Table class image

is there any way i can achieve transactions in dynamoDb with Python2.7

currently i have a class Table that is responsible for all my actions e.g put, update

to demonstrate what i am doing i am writing here example code

from imports.table import Table
def lambda_handler(event, context):
   -------------some code-------
   insert_user(user_json)
   update_role(role_json)
   insert_role(role_json)
   -------------some code-------
def insert_user(user_json)
   user_table = Table("user")
   return user_table.put_item(user_json)
def update_role(role_json)
   role_table = Table("role")
   return user_table.update_item_by_key(role_json)
def insert_role(role_json)
   role_table = Table("role")
   return user_table.put_item(role_json)

now the problem is i want to implement transactions here for these three function (can me more or lass according to requirement)

Is their any library available?
If not, what is the proper way to implement transactions here

Also I am attaching my Table class

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273