|
From: Nick S. <ni...@te...> - 2003-04-09 20:21:56
|
hi all, i'm fiddling around with SPOPS and ran into some problems: as seen in the example code, there is a class My::Commom which provides the method global_datasource_handle(). this method opens a db connection an saves the handle as class variable. other classes created by SPOPS inherit this method, so SPOPS always has access to the db handle via the global_datasource_handle() method. the problem is that everytime you create a new object from one of the SPOPS classes, a new db handle is created, because the connect part in the global_datasource_handle() method is executed. is there a way to save this execution and have *one* db handle for all objects? i don't know a way to pass a dbh reference to the newly created objects, i'd have to override the SPOPS class creation mechanism. has anyone code for this yet? there is something similar in OpenInteract called the "Stash" class, based on the Skeleton class. is this the right place to start? cheers, nick __________________________________________ nick sutterer cb&h productions ni...@te... the computer helps us solving problems which we wouldn't have without it. |