List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:April 27 2007 8:23pm
Subject:Re: lifetime of Ndb and Ndb_cluster_connection objects
View as plain text  
Mika Raento wrote:
> Hello
> 
> I get crashes in the destructor of Ndb depending a bit on how I declare
> variables in perl. I think perl doesn't have a deterministic destruction
> order by declaration order (since it does have reference counting). This
> means that calls like
> 
> my $myNdb = new mysql::cluster::ndbapi::Ndb($connection, "mq_cluster");

So one thing I'm working on right now relates to this. I'm merging code
over from NDB/J, and one thing they do is create all new objects through
factory methods - even the Ndb_cluster_connection (adding an NdbFactory
with a static createNdbClusterConnection() method) I think that once all
of that is copied over, it should be easier to indicate to SWIG the
ownership and appropriate reference counting of things. So that would
become:

my $myNdb = $connection->getNdb("mq_cluster");

Actually, I think getNdb is already there. Then if we do need to put in
hints, it will be ones that tell SWIG that $connection owns $myNdb and
$connection can't be deleted before $myNdb... but I think SWIG will do
this naturally.

-- 
Monty Taylor
Senior Consultant
MySQL Inc., www.mysql.com
Get More with MySQL!  www.mysql.com/consulting
Thread
Language-specific wrappers/extensionsMika Raento23 Apr
  • Re: Language-specific wrappers/extensionsMonty Taylor23 Apr
    • Re: Language-specific wrappers/extensionsMonty Taylor24 Apr
      • Re: Language-specific wrappers/extensionsMika Raento24 Apr
        • Re: Language-specific wrappers/extensionsMonty Taylor24 Apr
Re: Language-specific wrappers/extensionsMonty Taylor24 Apr
  • %/% rule in Makefile?Mika Raento25 Apr
    • Re: %/% rule in Makefile?Monty Taylor25 Apr
      • Re: %/% rule in Makefile?Mika Raento26 Apr
        • DocumentationMonty Taylor27 Apr
      • lifetime of Ndb and Ndb_cluster_connection objectsMika Raento26 Apr
        • Re: lifetime of Ndb and Ndb_cluster_connection objectsMonty Taylor27 Apr
          • Re: lifetime of Ndb and Ndb_cluster_connection objectsMika Raento7 May
            • Re: lifetime of Ndb and Ndb_cluster_connection objectsMonty Taylor7 May
      • Support for NdbIndex(Scan)Operation, prelim. support for typed attributeaccessMika Raento26 Apr
        • Re: Support for NdbIndex(Scan)Operation, prelim. support for typedattribute accessMonty Taylor28 Apr
Re: lifetime of Ndb and Ndb_cluster_connection objectsMonty Taylor8 May