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 |
|
my $ug = Data::UUID->new(); |
258 |
|
my $guid = $ug->create_str(); |
259 |
|
|
260 |
|
return $guid; |
261 |
|
} |
262 |
|
|
263 |
sub make_1st_id_in_tx |
sub make_1st_id_in_tx |
264 |
{ |
{ |
265 |
my ($self) = @_; |
my ($self) = @_; |
468 |
return $self->id($obj) |
return $self->id($obj) |
469 |
if $self->id($obj); |
if $self->id($obj); |
470 |
|
|
471 |
|
# insert global unique identifier in object to persist across re-deploys |
472 |
|
$obj->{guid} = $self->make_guid(); |
473 |
|
|
474 |
|
# debug |
475 |
|
use Data::Dumper; |
476 |
|
print Dumper($obj); |
477 |
|
|
478 |
$saving->insert($obj); |
$saving->insert($obj); |
479 |
|
|
480 |
my $class_name = ref $obj; |
my $class_name = ref $obj; |
504 |
|
|
505 |
if ($Tangram::TRACE) { |
if ($Tangram::TRACE) { |
506 |
printf $Tangram::TRACE "executing %s with (%s)\n", |
printf $Tangram::TRACE "executing %s with (%s)\n", |
507 |
$cache->{INSERTS}[$i], |
$cache->{INSERTS}[$i], |
508 |
join(', ', map { $_ || 'NULL' } @state[ @{ $fields->[$i] } ] ) |
join(', ', map { $_ || 'NULL' } @state[ @{ $fields->[$i] } ] ) |
509 |
} |
} |
510 |
|
|