/[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.28 - (show annotations)
Thu Feb 20 20:20:26 2003 UTC (21 years, 4 months ago) by joko
Branch: MAIN
Changes since 1.27: +28 -7 lines
tried to get auto-disconnect working again - failed with that

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

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