Comment on code
Charles Yeomans
charles at declareSub.com
Thu Dec 7 16:37:03 CST 2006
On Dec 7, 2006, at 4:17 PM, Ruslan Zasukhin wrote:
> On 12/7/06 10:46 PM, "Charles Yeomans" <yeomans at desuetude.com> wrote:
>
>> But now, consider the following code.
>>
>> dim connection as new VConnection("localhost", "sa", "sa")
>> connection.Open
>>
>> dim db as new VDatabase(connection)
>> db.Open new FolderItem("testDB")
>> db.Close
>>
>> exception oops
>> break
>
> I.e. Connection do not die because Database keep it?
>
> Hmm, but database should die self and kill then connection ...
The database does die. I don't know the inner workings, of course,
but since a single connection can support multiple databases, I would
guess that the connection knows about the databases using it. Either
the database must tell the connection that it is closing, or the
connection must be able to check a list of open databases to see
whether any of them are using the connection.
Charles Yeomans
More information about the Valentina
mailing list