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 |
|
|
250 |
|
|
251 |
|
# create global unique identifers using Data::UUID |
252 |
|
sub make_guid |
253 |
|
{ |
254 |
|
my $self = shift; |
255 |
|
|
256 |
|
eval ("use Data::UUID;"); |
257 |
|
return if $@; |
258 |
|
my $ug = Data::UUID->new(); |
259 |
|
my $guid = $ug->create_str(); |
260 |
|
|
261 |
|
return $guid; |
262 |
|
} |
263 |
|
|
264 |
sub make_1st_id_in_tx |
sub make_1st_id_in_tx |
265 |
{ |
{ |
266 |
my ($self) = @_; |
my ($self) = @_; |
469 |
return $self->id($obj) |
return $self->id($obj) |
470 |
if $self->id($obj); |
if $self->id($obj); |
471 |
|
|
472 |
|
# insert global unique identifier in object to persist across re-deploys |
473 |
|
$obj->{guid} = $self->make_guid(); |
474 |
|
|
475 |
$saving->insert($obj); |
$saving->insert($obj); |
476 |
|
|
477 |
my $class_name = ref $obj; |
my $class_name = ref $obj; |
501 |
|
|
502 |
if ($Tangram::TRACE) { |
if ($Tangram::TRACE) { |
503 |
printf $Tangram::TRACE "executing %s with (%s)\n", |
printf $Tangram::TRACE "executing %s with (%s)\n", |
504 |
$cache->{INSERTS}[$i], |
$cache->{INSERTS}[$i], |
505 |
join(', ', map { $_ || 'NULL' } @state[ @{ $fields->[$i] } ] ) |
join(', ', map { $_ || 'NULL' } @state[ @{ $fields->[$i] } ] ) |
506 |
} |
} |
507 |
|
|