/[cvs]/nfo/perl/libs/Data/Storage/Handler/Tangram.pm
ViewVC logotype

Contents of /nfo/perl/libs/Data/Storage/Handler/Tangram.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.29 - (show annotations)
Fri Feb 21 01:47:18 2003 UTC (21 years, 4 months ago) by joko
Branch: MAIN
Changes since 1.28: +22 -18 lines
purged old code
minor cosmetics

1 ############################################
2 #
3 # $Id: Tangram.pm,v 1.28 2003/02/20 20:20:26 joko Exp $
4 #
5 # $Log: Tangram.pm,v $
6 # Revision 1.28 2003/02/20 20:20:26 joko
7 # tried to get auto-disconnect working again - failed with that
8 #
9 # Revision 1.27 2003/01/31 06:30:59 joko
10 # + enabled 'sendQuery'
11 #
12 # Revision 1.26 2003/01/30 22:29:47 joko
13 # + fixed module usage (removed dependency on 'libp.pm')
14 #
15 # Revision 1.25 2003/01/19 02:30:05 joko
16 # + fix: modified call to '_initSchema'
17 #
18 # Revision 1.24 2002/12/22 14:13:01 joko
19 # + sub dropDb
20 #
21 # Revision 1.23 2002/12/19 16:31:53 joko
22 # +- renamed sub to 'rebuildDb'
23 #
24 # Revision 1.22 2002/12/18 22:28:16 jonen
25 # + added extended logging at 'getObjectByGuid()'
26 #
27 # Revision 1.21 2002/12/16 22:20:49 jonen
28 # + fixed bug at 'getObjectByGuid()'
29 #
30 # Revision 1.20 2002/12/16 20:49:17 jonen
31 # + added sub 'getObjectByGuid()'
32 # + added functionality to use 'getObjectByGuid' at 'getObjectAsHash()'
33 #
34 # Revision 1.19 2002/12/16 06:46:09 joko
35 # + attempt to introduce a generic '_patchSchema' - cancelled!
36 #
37 # Revision 1.18 2002/12/13 21:48:07 joko
38 # + fix to 'sub sendQuery'
39 #
40 # Revision 1.17 2002/12/12 02:51:09 joko
41 # + cosmetics
42 #
43 # Revision 1.16 2002/12/11 06:54:10 joko
44 # + fix: encapsulated object-loading inside an 'eval'
45 #
46 # Revision 1.15 2002/12/05 13:55:21 joko
47 # + now utilizing 'expand' instead of 'var_deref'
48 # + played around with having fresh-objects - no progress....
49 #
50 # Revision 1.14 2002/12/05 09:40:30 jonen
51 # + added option->{destroy} at getObject for unloading all instance
52 #
53 # Revision 1.13 2002/12/05 07:59:04 joko
54 # + now using Tie::SecureHash as a base for the COREHANDLE
55 # + former public COREHANDLE becomes private _COREHANDLE now
56 # + sub getCOREHANDLE
57 #
58 # Revision 1.12 2002/12/04 11:34:49 joko
59 # - $schema_tangram doesn't have to be in class?
60 #
61 # Revision 1.11 2002/12/04 08:54:08 jonen
62 # + untested bugfix: undef($object) after transform to hash at getObjectAsHash
63 #
64 # Revision 1.10 2002/12/03 15:53:23 joko
65 # + small bugfix regarding object hierarchy
66 #
67 # Revision 1.9 2002/12/03 05:29:40 joko
68 # + sub getObject
69 # + sub getObjectAsHash
70 #
71 # Revision 1.8 2002/12/01 22:25:51 joko
72 # + now utilizing metadata from storage locator when connecting to DBI in "raw"-mode
73 #
74 # Revision 1.7 2002/12/01 04:46:19 joko
75 # + sub eraseAll
76 #
77 # Revision 1.6 2002/11/29 05:02:30 joko
78 # - sub getNewPerlObjectByPkgName (moved to libp.pm)
79 # + sub getMetaInfo
80 # - sub existsChildNode (moved to Abstract.pm)
81 # + sub getListUnfiltered
82 # + sub getListFiltered
83 # + sub createCursor
84 # + sub createSet
85 # + sub sendQuery
86 #
87 # Revision 1.5 2002/11/17 06:35:18 joko
88 # + locator metadata can now be reached via ->{locator}
89 # - getChildNodes is now wrapped via COREHANDLE
90 #
91 # Revision 1.4 2002/10/25 11:44:44 joko
92 # + sub _initSchema
93 # + sub existsChildNode
94 # + sub testIntegrity
95 # + sub rebuildDbAndSchema
96 #
97 # Revision 1.3 2002/10/17 03:56:55 joko
98 # + bugfix: trapped eval error
99 #
100 # Revision 1.2 2002/10/17 00:10:05 joko
101 # + removed dependency from tsobj.pm, schema is now independent
102 # + sub getNewPerlObjectByPkgName
103 # + sub deploySchema
104 # + sub retreatSchema
105 #
106 # Revision 1.1 2002/10/10 03:44:07 cvsjoko
107 # + new
108 #
109 ############################################
110
111
112 package Data::Storage::Handler::Tangram;
113
114 use strict;
115 use warnings;
116
117 use base ("Data::Storage::Handler");
118 use base ("Data::Storage::Handler::Abstract");
119
120
121 use Data::Dumper;
122 use Tangram;
123
124 use DesignPattern::Object;
125 use Data::Storage::Result::Tangram;
126 use Data::Compare::Struct qw( isEmpty );
127 use Data::Transform::Deep qw( expand );
128
129 # get logger instance
130 my $logger = Log::Dispatch::Config->instance;
131
132
133 # this holds the complete instantiated schema from tangram
134 my $schema_tangram;
135
136 sub getMetaInfo {
137 my $self = shift;
138 $logger->debug( __PACKAGE__ . "->getMetaInfo()" );
139 return {
140 'disconnectMethod' => 'disconnect',
141 };
142 }
143
144 sub _initSchema {
145 my $self = shift;
146 $logger->debug( __PACKAGE__ . "->_initSchema()" );
147 #if (!$schema_tangram) {
148 #my $obj = getNewPerlObjectByPkgName($self->{locator}->{schema}, { EXPORT_OBJECTS => $self->{locator}->{classnames}, want_transactions => $self->{locator}->{want_transactions} } );
149 my $obj = DesignPattern::Object->fromPackage($self->{locator}->{schema}, { 'EXPORT_OBJECTS' => $self->{locator}->{classnames}, 'want_transactions' => $self->{locator}->{want_transactions} } );
150 $schema_tangram = $obj->getSchema();
151 #}
152 if (!$schema_tangram) {
153 $logger->error( __PACKAGE__ . "->_initSchema: No Schema available for $self->{schema}" );
154 return 0;
155 }
156 #$self->_patchSchema();
157 return 1;
158 }
159
160 sub _patchSchema {
161 my $self = shift;
162 foreach (keys %{$schema_tangram->{classes}}) {
163 next if $schema_tangram->{classes}->{$_}->{abstract};
164 #next if ($_ ne 'TsBankAccount');
165 #$_ ne 'AbstractAccount' &&
166 print "class: $_", "\n";
167 #print Dumper($schema_tangram->{classes}->{$_});
168 # create new string property named 'guid'
169 my $tstring = Tangram::String->new();
170 $tstring->{name} = $tstring->{col} = 'guid';
171 # inject property into schema
172 #$schema_tangram->{classes}->{$_}->{root}->{SPECS}->[0]->{fields}->{string}->{$tstring->{name}} = $tstring;
173 print Dumper($schema_tangram->{classes}->{$_}->{root}->{SPECS}->[0]->{fields});
174 }
175 }
176
177 sub connect {
178
179 my $self = shift;
180
181 my $dsn = shift;
182
183 #print Dumper($self);
184 #exit;
185
186 # TODO: re-enable
187 $dsn ||= $self->{locator}->{dbi}->{dsn};
188 $logger->debug( __PACKAGE__ . "->connect( dsn $dsn )" );
189
190 #my $storage = Tangram::Relational->connect( $schema, $dsn );
191 #my $storage = Tangram::mysql->connect( $schema, $dsn );
192 #$storage = Tangram::Relational->connect( Project->schema, $dsn );
193
194 # if (!testDsn($dsn)) {
195 # croak("Database at \"$dsn\" is not available");
196 # return;
197 # }
198
199 #return unless $self->_initSchema();
200 $self->_initSchema();
201
202 # create the main tangram storage object
203 #$self->{COREHANDLE} = Tangram::Relational->connect( $schema, $dsn );
204 $self->{_COREHANDLE} = Tangram::Relational->connect( $schema_tangram, $dsn );
205
206 #print "connect", "\n";
207 #my $core = $self->{_COREHANDLE};
208 #print Dumper($core);
209
210 # some attempts for configuring the wrapped underlying dbi.....
211 #$self->{STORAGEHANDLE_UNDERLYING} = $self->getUnderlyingStorage();
212 #$self->{STORAGEHANDLE_UNDERLYING}->_configureCOREHANDLE();
213 #$self->_configureUnderlyingStorage;
214
215 # ..... encapsulation wins!
216 $self->configureCOREHANDLE();
217
218 $self->{locator}->{status}->{connected} = 1;
219
220 return 1;
221
222 }
223
224 sub getChildNodes {
225
226 my $self = shift;
227 my @nodes;
228
229 $logger->debug( __PACKAGE__ . "->getChildNodes()" );
230
231 # create new DBI - Data::Storage - object from already connected DBI::db - handle inside the current COREHANDLE
232 #my $loc = new Data::Storage::Locator( type => "DBI", dbi => { db => $self->{COREHANDLE}->{db} });
233 #my $loc = new Data::Storage::Locator( type => "DBI", COREHANDLE => $self->{COREHANDLE}->{db} );
234
235 # todo: should we retrieve information from the schema here
236 # rather than poorly getting table names from underlying dbi?
237 my $storage = $self->_getSubLayerHandle();
238 @nodes = @{$storage->getChildNodes()};
239 #$storage->_configureCOREHANDLE();
240 #print "getchildnodes\n";
241 #print Dumper($self);
242 #if (my $result = $self->sendCommand( 'SHOW TABLES;' ) ) {
243
244 # TODO: REVIEW
245 #$storage->disconnect();
246
247 $self->{meta}->{childnodes} = \@nodes;
248
249 return \@nodes;
250
251 }
252
253
254 sub testIntegrity {
255
256 my $self = shift;
257
258 $logger->debug( __PACKAGE__ . "->testIntegrity()" );
259
260 # 1st test: are there tables?
261 if (!$self->getChildNodes()) {
262 $logger->warning( __PACKAGE__ . "->testIntegrity no childnodes exist" );
263 return;
264 }
265
266 # 2nd test: is there a table named "Tangram"?
267 if (!$self->existsChildNode("Tangram")) {
268 $logger->warning( __PACKAGE__ . "->testIntegrity childnode \"Tangram\" doesn't exist" );
269 return;
270 }
271
272 $self->{locator}->{status}->{integrity} = 1;
273 return 1;
274
275 }
276
277
278 sub _getSubLayerHandle {
279
280 my $self = shift;
281
282 $logger->debug( __PACKAGE__ . "->_getSubLayerHandle()" );
283
284 #print Dumper($self);
285
286 # hack, make more generic!
287 if (!$self->{dataStorageLayer}) {
288 $logger->debug( __PACKAGE__ . "->_getSubLayerHandle() creating new dataStorageLayer" );
289 #my $loc = Data::Storage::Locator->new( type => "DBI", dbi => $self->{dbi}, COREHANDLE => $self->{COREHANDLE}->{db} );
290 my $loc = Data::Storage::Locator->new( { type => "DBI", dbi => $self->{locator}->{dbi} } );
291 $self->{dataStorageLayer} = Data::Storage->new( $loc, { protected => 1 } );
292 #$self->{STORAGE_UNDER_THE_HOOD}->{STORAGEHANDLE}->_configureCOREHANDLE();
293 #$self->{STORAGE_UNDER_THE_HOOD}->_configureCOREHANDLE();
294 }
295
296 #print Dumper($self->{STORAGE_UNDER_THE_HOOD});
297
298 return $self->{dataStorageLayer};
299
300 }
301
302 sub _configureUnderlyingStorage {
303
304 my $self = shift;
305
306 $logger->debug( __PACKAGE__ . "->_configureUnderlyingStorage" );
307
308 $self->_configureCOREHANDLE_DBI();
309 return;
310
311 foreach my $key (keys %{$self->{dbi}}) {
312 my $val = $self->{dbi}->{$key};
313 print "entry: $key; $val", "\n";
314 $self->{_COREHANDLE}->{db}->{$key} = $val;
315 }
316 #print Dumper($self->{COREHANDLE}->{db});
317 }
318
319
320 sub configureCOREHANDLE {
321
322 my $self = shift;
323
324 $logger->debug( __PACKAGE__ . "->configureCOREHANDLE" );
325
326 #my $subLayer = $self->_getSubLayerHandle();
327 #print Dumper($self);
328 #exit;
329
330 # apply configured modifications
331 if (exists $self->{dbi}->{trace_level} && exists $self->{dbi}->{trace_file}) {
332 $self->{_COREHANDLE}->{db}->trace($self->{dbi}->{trace_level}, $self->{dbi}->{trace_file});
333 }
334 if (exists $self->{dbi}->{RaiseError}) {
335 $self->{_COREHANDLE}->{db}->{RaiseError} = $self->{dbi}->{RaiseError};
336 }
337 if (exists $self->{dbi}->{PrintError}) {
338 $self->{_COREHANDLE}->{db}->{PrintError} = $self->{dbi}->{PrintError};
339 }
340 if (exists $self->{dbi}->{HandleError}) {
341 $self->{_COREHANDLE}->{db}->{HandleError} = $self->{dbi}->{HandleError};
342 }
343
344 }
345
346 sub deploySchema {
347 my $self = shift;
348 my $args = shift;
349
350 my $dsn = $self->{locator}->{dbi}->{dsn};
351
352 $logger->debug( __PACKAGE__ . "->deploySchema( dsn $dsn )" );
353
354 my $ok;
355 if ( my $dbh = DBI->connect($dsn, '', '', $self->{locator}->{dbi} ) ) {
356 return unless $self->_initSchema();
357 $ok = Tangram::Relational->deploy($schema_tangram, $dbh );
358 $dbh->disconnect();
359 }
360 return $ok;
361 }
362
363 sub retreatSchema {
364
365 my $self = shift;
366 my $dsn = $self->{locator}->{dbi}->{dsn};
367
368 $logger->debug( __PACKAGE__ . "->retreatSchema( dsn $dsn )" );
369
370 my $ok;
371 if ( my $dbh = DBI->connect($dsn, '', '', $self->{locator}->{dbi} ) ) {
372
373 return unless $self->_initSchema();
374
375 #use Data::Dumper; print Dumper($self);
376 $self->{dataStorageLayer}->removeLogDispatchHandler("Tangram11");
377
378 $ok = Tangram::Relational->retreat($schema_tangram, $dbh );
379
380 # answer "$ok=2" means "maybe" for now - we have to patch this to a constant here because...
381 # - ... Tangram::Relational->retreat doesn't seem to return a valid status
382 # - possible improvement:
383 # - test this by checking for count of tables in database
384 # - problem with this: there may be some left not having been included to the schema
385 # - maybe better: use "->getChildNodes"?
386 $ok = 2;
387
388 $dbh->disconnect();
389
390 }
391 return $ok;
392 }
393
394 sub rebuildDb {
395 my $self = shift;
396 $logger->info( __PACKAGE__ . "->rebuildDb()" );
397 my @results;
398
399 # sum up results (bool (0/1)) in array
400 push @results, $self->retreatSchema();
401 push @results, $self->{dataStorageLayer}->dropDb();
402 push @results, $self->{dataStorageLayer}->createDb();
403 push @results, $self->deploySchema();
404
405 # scan array for "bad ones"
406 my $res = 1;
407 map {
408 $res = 0 if (!$_);
409 } @results;
410
411 return $res;
412 }
413
414 sub getListUnfiltered {
415 my $self = shift;
416 my $nodename = shift;
417 my @results;
418 $logger->debug( __PACKAGE__ . "->getListUnfiltered( nodename => '" . $nodename . "' )" );
419 # get set of objects from odbms by object name
420 my $object_set = $self->{_COREHANDLE}->remote($nodename);
421 @results = $self->{_COREHANDLE}->select($object_set);
422 return \@results;
423 }
424
425 sub getListFiltered {
426 my $self = shift;
427
428 # redirect to unfiltered mode
429 #return $self->getListUnfiltered(@_);
430
431 my $nodename = shift;
432 my $filters = shift;
433 my @results;
434 $logger->debug( __PACKAGE__ . "->getListFiltered( nodename => '" . $nodename . "' )" );
435
436 #print Dumper($filters);
437
438 my @tfilters;
439
440 foreach my $filter (@$filters) {
441
442 # get filter - TODO: for each filter
443 #my $filter = $filters->[0];
444
445 # build filter
446 my $lexpr = $filter->{key};
447 #my $op = $filter->{op};
448 my $op = '=';
449 my $rexpr = $filter->{val};
450 my $tight = 100;
451
452 # my $tfilter = Tangram::Filter->new(
453 # expr => "t1.$lexpr $op '$rexpr'",
454 # tight => $tight,
455 # objects => $objects,
456 # );
457
458 # HACK: build eval-string (sorry) to get filtered list - please give advice here
459 push @tfilters, '$remote->{' . $filter->{key} . '}' . " $filter->{op} '$filter->{val}'";
460
461 }
462
463 my $tfilter = join(' & ', @tfilters);
464
465 # get set of objects from odbms by object name
466 my $remote = $self->{_COREHANDLE}->remote($nodename);
467
468 # was:
469 #@results = $self->{COREHANDLE}->select($object_set, $tfilter);
470
471 # is:
472 # HACK: build eval-string (sorry) to get filtered list - please give advice here
473 my $evalstring = 'return $self->{_COREHANDLE}->select($remote, ' . $tfilter . ');';
474
475 #print "eval: $evalstring", "\n";
476
477 # get filtered list/set
478 @results = eval($evalstring);
479 die $@ if $@;
480
481 return \@results;
482 }
483
484 sub createCursor {
485 my $self = shift;
486 my $node = shift;
487 my $cmdHandle = $self->{_COREHANDLE}->cursor($node);
488 my $result = Data::Storage::Result::Tangram->new( RESULTHANDLE => $cmdHandle );
489 return $result;
490 }
491
492 sub createSet {
493 my $self = shift;
494 #print "-" x 80, "\n";
495 #print Dumper(@_);
496 my @objects = @_;
497 my $rh = Set::Object->new();
498 foreach (@objects) {
499 if (!isEmpty($_)) {
500 #print Dumper($_);
501 $rh->insert($_);
502 }
503 }
504 #print Dumper($rh->members());
505 my $result = Data::Storage::Result::Tangram->new( RESULTHANDLE => $rh );
506 return $result;
507 }
508
509 sub sendQuery {
510 my $self = shift;
511 my $query = shift;
512 #my $sql = "SELECT cs FROM $self->{metainfo}->{$descent}->{node} WHERE $self->{metainfo}->{$descent}->{IdentProvider}->{arg}='$self->{entry}->{source}->{ident}';";
513 #my $result = $self->{metainfo}->{$descent}->{storage}->sendCommand($sql);
514
515 #print Dumper($query);
516
517 # HACK: special case: querying by id does not translate into a common tangram query
518 # just load the object by given id(ent)
519 if ($query->{criterias}->[0]->{key} eq 'id' && $query->{criterias}->[0]->{op} eq 'eq') {
520 #print "LOAD!!!", "\n";
521 #exit;
522 #return Set::Object->new( $self->{COREHANDLE}->load($query->{criterias}->[0]->{val}) );
523 my $ident = $query->{criterias}->[0]->{val};
524 #print "load obj", "\n";
525 #return $self->createSet() if $ident == 5;
526 $self->{_COREHANDLE}->unload($ident);
527 my $object = $self->{_COREHANDLE}->load($ident);
528 #print "get id", "\n";
529 my $oid = $self->{_COREHANDLE}->id($object);
530 #print Dumper($object);
531 #print "oid: $oid", "\n";
532 return $self->createSet($object);
533 #return $self->createSet( $self->{COREHANDLE}->load('300090018') );
534 }
535
536 my $list = $self->getListFiltered($query->{node}, $query->{criterias});
537 #return $self->createSet($object);
538 #return $self->createSet($list);
539 return $self->createSet(@$list);
540
541 #die("This should not be reached for now - redirect to \$self->getListFiltered() here!");
542
543
544
545
546 # try a generic tangram query here
547 # TODO: try to place an oql on top of that (search.cpan.org!)
548 my @crits;
549 foreach (@{$query->{criterias}}) {
550 my $op = '';
551 $op = '=' if lc $_->{op} eq 'eq';
552 push @crits, "$_->{key}$op'$_->{val}'";
553 }
554 my $subnodes = {};
555 map { $subnodes->{$_}++ } @{$query->{subnodes}};
556 # HACK: this is hardcoded ;( expand possibilities!
557 #my $crit = join(' AND ', @crits);
558 #my $sql = hash2Sql($query->{node}, $subnodes, 'SELECT', $crit);
559 #return $self->sendCommand($sql);
560 #my $h = $self->{COREHANDLE}->remote($query->{node});
561 #my $res = $self->{COREHANDLE}->select($h, $h->{);
562 return $self->createCursor($query->{node});
563 }
564
565 sub eraseAll {
566 my $self = shift;
567 my $classname = shift;
568 my $remote = $self->{_COREHANDLE}->remote($classname);
569 my @objs = $self->{_COREHANDLE}->select($remote);
570 $self->{_COREHANDLE}->erase(@objs);
571 }
572
573 sub createDb {
574 my $self = shift;
575 my $storage = $self->_getSubLayerHandle();
576 return $storage->createDb();
577 }
578
579 sub getObject {
580 my $self = shift;
581 my $oid = shift;
582 my $options = shift;
583
584 # TODO: create a deep_unload method (currently _all_ objects are unloaded)
585 # unload($oid) will only unload object, not deep object hashes
586 $self->{_COREHANDLE}->unload() if ($options->{destroy});
587
588 # TODO: review this
589 #if (!$self->{COREHANDLE}) { return; }
590
591 # TODO: review this
592 my $object = eval('$self->{_COREHANDLE}->load($oid);');
593 print $@, "\n" if $@;
594
595 return $object if $object;
596 }
597
598 sub getObjectByGuid {
599 my $self = shift;
600 my $guid = shift;
601 my $options = shift;
602
603 # Guid and Classname is needed
604 if(!$guid || !$options->{classname}) {
605 $logger->error( __PACKAGE__ . "->getObjectByGuid: No 'guid' OR no Classname in options hash was given but needed!" );
606 return;
607 }
608
609 # TODO: create a deep_unload method (currently _all_ objects are unloaded)
610 # unload($oid) will only unload object, not deep object hashes
611 $self->{_COREHANDLE}->unload() if ($options->{destroy});
612
613 # search for object with given Classname and Guid
614 my $obj_tmp = $self->{_COREHANDLE}->remote($options->{classname});
615 my @result = $self->{_COREHANDLE}->select($obj_tmp, $obj_tmp->{guid} eq $guid);
616
617 # we searched for global unique identifer of some object,
618 # so I think we can trust there would be only one result
619 if($result[0]) {
620 return $result[0];
621 } else {
622 $logger->error( __PACKAGE__ . "->getObjectByGuid: No Object with Classname $options->{classname} and GUID $guid found!" );
623 return;
624 }
625
626 }
627
628 sub getObjectAsHash {
629 my $self = shift;
630 my $oid = shift;
631 my $options = shift;
632 my $obj;
633
634 if($options->{guid}) {
635 $obj = $self->getObjectByGuid($oid, $options);
636 } else {
637 $obj = $self->getObject($oid, $options);
638 }
639
640 # build options (a callback to unload autovivified objects) for 'expand'
641 # TODO: use $logger to write to debug here!
642 my $cb; # = sub {};
643
644 # deactivated way to get rid of used instances, if requested
645 =pod
646 if ($options->{destroy}) {
647 $options->{cb}->{destroy} = sub {
648 print "================ DESTROY", "\n";
649 my $object = shift;
650 #print Dumper($object);
651 $self->{_COREHANDLE}->unload($object);
652 #undef($object);
653 };
654 }
655 =cut
656
657 my $hash = expand($obj, $options);
658
659 # old (unsuccessful) attempts to get rid of used instances, if requested
660
661 # V1:
662 #$options->{cb}->{destroy}->($obj);
663 #$self->{_COREHANDLE}->unload($obj);
664
665 # V2:
666 #$obj->clear_refs;
667 #$self->{COREHANDLE}->unload($obj) if($options->{destroy});
668 #$obj->DESTROY;
669 #undef($obj) if($options->{destroy});
670
671 return $hash;
672 }
673
674 sub getSchema {
675 return $schema_tangram;
676 }
677
678 sub getCOREHANDLE {
679 my $self = shift;
680 return $self->{_COREHANDLE};
681 }
682
683 sub dropDb {
684 my $self = shift;
685 my $storage = $self->_getSubLayerHandle();
686 return $storage->dropDb();
687 }
688
689 sub testAvailability {
690 my $self = shift;
691 my $storage = $self->_getSubLayerHandle();
692 return $storage->testAvailability();
693 }
694
695 sub disconnect2 {
696 my $self = shift;
697 my $storage = $self->_getSubLayerHandle();
698 print "DISC!", "\n";
699
700 my $storage_ll = $storage->{_COREHANDLE};
701 $storage_ll->disconnect();
702
703 print Dumper($storage);
704 exit;
705
706 #$self->{_COREHANDLE}
707 #$storage->disconnect();
708 $self->{dataStorageLayer}->disconnect();
709 }
710
711 1;
712 __END__

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed