On 5/24/06, Jonathan Vanasco <[EMAIL PROTECTED]> wrote:
if i change a rosedb obj class, the methodmaker dies

[Wed May 24 16:49:09 2006] [error] [client 127.0.0.1] Cannot create
method MyApp::RoseDB::Useraccount::useraccount_id - method already
exists at /Library/Perl/5.8.6/Rose/DB/Object/Metadata/MethodMaker.pm
line 420\nCompilation failed in require at /Library/Perl/5.8.6/darwin-
thread-multi-2level/Apache2/Reload.pm line 160.\n, referer: http://
127.0.0.1:7081/

the fix is to restart, but thats a pain for development
any suggestions?

Either wrap your class setup in a conditional that will only be run once:

   unless(__PACKAGE__->meta->is_initialized)
   {
     __PACKAGE__->meta->columns(...);
     ...
     __PACKAGE__->meta->initialize(...);
   }

or pass a "replace_existing => 1" argument to your calls to
->meta->initialize(...):

   __PACKAGE__->meta->initialize(replace_existing  => 1);

which will cause all your methods to be re-created each time the
module is reloaded.

(Wrapping your class setup in a BEGIN block may work too, but I'm not
sure if Apache::Reload re-executes BEGIN blocks or not...)

-John


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to