247 |
return sprintf "%d%0$self->{cid_size}d", $id, $class_id; |
return sprintf "%d%0$self->{cid_size}d", $id, $class_id; |
248 |
} |
} |
249 |
|
|
|
|
|
|
# create global unique identifers using Data::UUID |
|
|
sub make_guid |
|
|
{ |
|
|
my $self = shift; |
|
|
|
|
|
eval ("use Data::UUID;"); |
|
|
my $ug = Data::UUID->new(); |
|
|
my $guid = $ug->create_str(); |
|
|
|
|
|
return $guid; |
|
|
} |
|
|
|
|
250 |
sub make_1st_id_in_tx |
sub make_1st_id_in_tx |
251 |
{ |
{ |
252 |
my ($self) = @_; |
my ($self) = @_; |
455 |
return $self->id($obj) |
return $self->id($obj) |
456 |
if $self->id($obj); |
if $self->id($obj); |
457 |
|
|
|
# insert global unique identifier in object to persist across re-deploys |
|
|
$obj->{guid} = $self->make_guid(); |
|
|
|
|
|
# debug |
|
|
use Data::Dumper; |
|
|
print Dumper($obj); |
|
|
|
|
458 |
$saving->insert($obj); |
$saving->insert($obj); |
459 |
|
|
460 |
my $class_name = ref $obj; |
my $class_name = ref $obj; |
484 |
|
|
485 |
if ($Tangram::TRACE) { |
if ($Tangram::TRACE) { |
486 |
printf $Tangram::TRACE "executing %s with (%s)\n", |
printf $Tangram::TRACE "executing %s with (%s)\n", |
487 |
$cache->{INSERTS}[$i], |
$cache->{INSERTS}[$i], |
488 |
join(', ', map { $_ || 'NULL' } @state[ @{ $fields->[$i] } ] ) |
join(', ', map { $_ || 'NULL' } @state[ @{ $fields->[$i] } ] ) |
489 |
} |
} |
490 |
|
|