List:NDB Connectors« Previous MessageNext Message »
From:Mika Raento Date:April 26 2007 12:02pm
Subject:lifetime of Ndb and Ndb_cluster_connection objects
View as plain text  
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");

should increment the refcount of the perl-side $connection and deletion 
of the $myNdb should decrease the count.

I'm not sure if there is a real way of doing this in SWIG, not at least 
without writing quite a lot of code. It would need something like:
* add a new typemap for input parameters that should be addref'ed
* write the addref code for each target language
* wrap deletion of Ndb objects to decrease the native refcount of the 
connection
* write the decref code for each target language

The other option is to have a target-language side module that takes 
care of extending the lifetime of the connection over the lifetime of 
the Ndb.

    Mika
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