beeftaco
beeftaco

Reputation: 63

GAE Django Transaction

I have been developing on the GAE dev_appserver and my code relied heavily on Django's transactionmiddleware. I have tested it locally and it works.

After deployment to GAE, however, model saves that are committed are not rolled back.

Sample code:

@transaction.commit_on_success
def get(self, request):
    name = request.GET.get('name')
    d = Department(name=name)
    d.save()
    raise Exception('Failed')

Is this because Django transaction API is not honored by GAE or is it a problem on my app settings?

FYI django.middleware.transaction.TransactionMiddleware is currently last on the list of MIDDLEWARE_CLASSES

Upvotes: 2

Views: 46

Answers (1)

knbk
knbk

Reputation: 53649

According to this website, the Django database backend for Google App Engine does not support Django transactions. You can however use the run_in_transaction method from the App Engine's SDK.

Upvotes: 1

Related Questions