Changeset 2108


Ignore:
Timestamp:
09/28/17 07:50:50 (7 years ago)
Author:
nanardon
Message:

Think to commit data after change

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote/Write.pm

    r2106 r2108  
    4242 
    4343    my $res = $c->model('Accounts')->db->create_c_object($otype, $name, %info); 
    44     if (!$res) { 
     44    if ($res) { 
     45        $c->model('Accounts')->db->commit; 
     46    } else { 
    4547        $c->stash->{data}{error} = LATMOS::Accounts::Log::lastmessage(LA_ERR); 
    4648    } 
     
    6466    if (my $obj = $c->model('Accounts')->db->get_object($otype, $name)) { 
    6567        $c->stash->{data}{result} = $obj->set_c_fields(%info) || 0; 
    66         if (! $c->stash->{data}{result}) { 
     68        if ($c->stash->{data}{result}) { 
     69            $c->model('Accounts')->db->commit; 
     70        } else { 
    6771            $c->stash->{data}{error} = LATMOS::Accounts::Log::lastmessage(LA_ERR); 
    6872        } 
     
    8690    my $res = $c->model('Accounts')->db->delete_object($otype, $name);  
    8791    $c->stash->{data}{result} = $res ? 1 : 0; 
    88     if (! $c->stash->{data}{result}) { 
     92    if ($c->stash->{data}{result}) { 
     93        $c->model('Accounts')->db->commit; 
     94    } else { 
    8995        $c->stash->{data}{error} = LATMOS::Accounts::Log::lastmessage(LA_ERR); 
    9096    } 
Note: See TracChangeset for help on using the changeset viewer.