connection close on image save

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

connection close on image save

mmimica
Hello

It seems that dbx connection is closed when image is saved save. I have been using OpenDBX before, but haven't noticed this behavior, although I'm using Pharo 1.4 now.
Is this some kind of a known feature or should I investigate?


--
Milan Mimica
http://sparklet.sf.net
Reply | Threaded
Open this post in threaded view
|

Re: connection close on image save

Mariano Martinez Peck


On Thu, Jun 7, 2012 at 2:38 PM, Milan Mimica <[hidden email]> wrote:
Hello

It seems that dbx connection is closed when image is saved save. I have been using OpenDBX before, but haven't noticed this behavior, although I'm using Pharo 1.4 now.
Is this some kind of a known feature or should I investigate?


Hi. Yes, this is *on purpose* and it has been around since the very beginning. The idea was that the devleoper always should close connections. But just in case someone forget, we disconnect the connections when the image is quited, so that not to let opened connections to the database.
For more details check senders of #addObjectToGarbageCollect:

Cheers
 

--
Milan Mimica
http://sparklet.sf.net



--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|

Re: connection close on image save

mmimica
On 7 June 2012 14:44, Mariano Martinez Peck <[hidden email]> wrote:

Hi. Yes, this is *on purpose* and it has been around since the very beginning. The idea was that the devleoper always should close connections. But just in case someone forget, we disconnect the connections when the image is quited, so that not to let opened connections to the database.
For more details check senders of #addObjectToGarbageCollect:

I know about that, but I am not quitting! I am just *saving* and trying to merely continue my work.


--
Milan Mimica
http://sparklet.sf.net
Reply | Threaded
Open this post in threaded view
|

Re: connection close on image save

Mariano Martinez Peck


On Thu, Jun 7, 2012 at 5:13 PM, Milan Mimica <[hidden email]> wrote:
On 7 June 2012 14:44, Mariano Martinez Peck <[hidden email]> wrote:

Hi. Yes, this is *on purpose* and it has been around since the very beginning. The idea was that the devleoper always should close connections. But just in case someone forget, we disconnect the connections when the image is quited, so that not to let opened connections to the database.
For more details check senders of #addObjectToGarbageCollect:

I know about that, but I am not quitting! I am just *saving* and trying to merely continue my work.

mmmm then I guess you found a bug. I think that we should remove:

DBXConnection class >> shutDown
    self
        allInstancesDo: [:each | each shutDown]

and add:

DBXConnection class >> shutDown: quitting
    quitting ifTrue: [ self allInstancesDo: [:each | each shutDown]


can you try it please and let us know? That shuld only disconnect when quitting.

thanks
 


--
Milan Mimica
http://sparklet.sf.net



--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|

Re: connection close on image save

mmimica
On 7 June 2012 17:20, Mariano Martinez Peck <[hidden email]> wrote:
I know about that, but I am not quitting! I am just *saving* and trying to merely continue my work.

mmmm then I guess you found a bug. I think that we should remove:

DBXConnection class >> shutDown
    self
        allInstancesDo: [:each | each shutDown]

and add:

DBXConnection class >> shutDown: quitting
    quitting ifTrue: [ self allInstancesDo: [:each | each shutDown]


can you try it please and let us know? That shuld only disconnect when quitting.

That worked, thanks!
Note that
DBXConnection class >>startUp
"The OpenDBX current has to be reinitialized just in case the same image is loaded in a different Operating System"
OpenDBX current: nil.

is still called, but does no harm, I guess because it reinitializes itself later.


--
Milan Mimica
http://sparklet.sf.net
Reply | Threaded
Open this post in threaded view
|

Re: connection close on image save

Mariano Martinez Peck


On Thu, Jun 7, 2012 at 5:35 PM, Milan Mimica <[hidden email]> wrote:
On 7 June 2012 17:20, Mariano Martinez Peck <[hidden email]> wrote:
I know about that, but I am not quitting! I am just *saving* and trying to merely continue my work.

mmmm then I guess you found a bug. I think that we should remove:

DBXConnection class >> shutDown
    self
        allInstancesDo: [:each | each shutDown]

and add:

DBXConnection class >> shutDown: quitting
    quitting ifTrue: [ self allInstancesDo: [:each | each shutDown]


can you try it please and let us know? That shuld only disconnect when quitting.

That worked, thanks!


Excellent. Commited in OpenDBXDriver-MarianoMartinezPeck.38.
 
Note that
DBXConnection class >>startUp
"The OpenDBX current has to be reinitialized just in case the same image is loaded in a different Operating System"
OpenDBX current: nil.

is still called, but does no harm, I guess because it reinitializes itself later.


yes, it does not harm but I have just fixed also:

startUp: resumming
    "The OpenDBX current has to be reinitialized just in case the same image is loaded in a different Operating System"
    resumming ifTrue: [OpenDBX current: nil].
 

--
Milan Mimica
http://sparklet.sf.net



--
Mariano
http://marianopeck.wordpress.com