TT#44095 set isolation level when creating contracts

Change-Id: Ie7944be85ea60626050896988f49917249ccc3f5
changes/27/23427/2
Rene Krenn 7 years ago
parent 29a8ca6918
commit 7b5c9d9fa6

@ -131,6 +131,7 @@ sub GET :Allow {
sub POST :Allow { sub POST :Allow {
my ($self, $c) = @_; my ($self, $c) = @_;
$c->model('DB')->set_transaction_isolation('READ COMMITTED');
my $guard = $c->model('DB')->txn_scope_guard; my $guard = $c->model('DB')->txn_scope_guard;
{ {
my $schema = $c->model('DB'); my $schema = $c->model('DB');

@ -202,6 +202,7 @@ sub GET :Allow {
sub POST :Allow { sub POST :Allow {
my ($self, $c) = @_; my ($self, $c) = @_;
$c->model('DB')->set_transaction_isolation('READ COMMITTED');
my $guard = $c->model('DB')->txn_scope_guard; my $guard = $c->model('DB')->txn_scope_guard;
{ {
my $schema = $c->model('DB'); my $schema = $c->model('DB');

@ -363,6 +363,7 @@ sub peering_create :Chained('peering_list') :PathPart('create') :Args(0) {
if($posted && $form->validated) { if($posted && $form->validated) {
try { try {
my $schema = $c->model('DB'); my $schema = $c->model('DB');
$schema->set_transaction_isolation('READ COMMITTED');
$schema->txn_do(sub { $schema->txn_do(sub {
foreach(qw/contact billing_profile/){ foreach(qw/contact billing_profile/){
$form->values->{$_.'_id'} = $form->values->{$_}{id} || undef; $form->values->{$_.'_id'} = $form->values->{$_}{id} || undef;
@ -503,6 +504,7 @@ sub reseller_create :Chained('reseller_list') :PathPart('create') :Args(0) {
if($posted && $form->validated) { if($posted && $form->validated) {
try { try {
my $schema = $c->model('DB'); my $schema = $c->model('DB');
$schema->set_transaction_isolation('READ COMMITTED');
$schema->txn_do(sub { $schema->txn_do(sub {
foreach(qw/contact billing_profile/){ foreach(qw/contact billing_profile/){
$form->values->{$_.'_id'} = $form->values->{$_}{id} || undef; $form->values->{$_.'_id'} = $form->values->{$_}{id} || undef;

@ -202,6 +202,7 @@ sub create :Chained('list_customer') :PathPart('create') :Args(0) {
if($posted && $form->validated) { if($posted && $form->validated) {
try { try {
my $schema = $c->model('DB'); my $schema = $c->model('DB');
$schema->set_transaction_isolation('READ COMMITTED');
$schema->txn_do(sub { $schema->txn_do(sub {
foreach(qw/contact billing_profile profile_package product subscriber_email_template passreset_email_template invoice_email_template invoice_template/){ foreach(qw/contact billing_profile profile_package product subscriber_email_template passreset_email_template invoice_email_template invoice_template/){
$form->values->{$_.'_id'} = $form->values->{$_}{id} || undef; $form->values->{$_.'_id'} = $form->values->{$_}{id} || undef;

Loading…
Cancel
Save