[wxpython-users] App does not close down - py2exe - work around

Andrea Gavana andrea.gavana at gmail.com
Wed May 28 03:14:41 PDT 2008


Hi Werner,

On Wed, May 28, 2008 at 9:39 AM, Werner F. Bruhin wrote:
> Hi Andrea,
>
> Andrea Gavana wrote:
>>
>> Hi Werner,
>>
>> On Wed, May 28, 2008 at 8:41 AM, Werner F. Bruhin wrote:
>>
>>>
>>> Just an update in case anyone else runs into this.
>>>
>>> The problem seems to come from sqlalchemy, but I am not yet sure how to
>>> resolved it nicely, but in the mean time I am using the following work
>>> around.
>>>
>>> self.engine = db.sa.create_engine(dburl, encoding='utf8', echo=False)
>>> self.Session = db.sao.sessionmaker(autoflush=True, transactional=True)
>>> self.Session.configure(bind=self.engine)
>>> self.ds = self.Session()
>>> ...
>>> self.ds.Close()
>>>
>>> # adding the following allows the app to close down correctly
>>> del self.ds
>>> del self.Session
>>> del self.engine
>>>
>>>
>>> Mentioned it on the SA list, but had no feedback yet.
>>>
>>
>> I am using SQLAlchemy as well in one of my apps,
>
> What version of SA are you using?  I am currently on 0.4.3, but I hope that
> 0.5 will be out before I am ready to release my new version.  If I read the
> doc for 0.5 I see that some Session related stuff is changed/clean-up, so
> maybe the problem is already dealt with in 0.5 (will try it as soon as an
> alpha or beta version is available).

After a migration from 0.3.4 (which has been a PITA), I am now using
0.4.6. There have been so many changes between 0.3 and 0.4 that I am
still looking for possible bugs in my application because of that. Not
to mention what has been done on the (once) useful and friendly
select() statement.

> I also like the auto expire after commit in 0.5 as I have to do a lot of
> expire or refresh calls to get the correct data displayed (i.e. update a
> relation and if you then display the master of the relation the data is not
> updated).
>>
>>  and I didn't have
>> this kind of problems... I suspect you are using a different "backend"
>> in SQLAlchemy (i.e., I use it to access SQLite, while I think you are
>> using Firebird or whatever is its name :-D ).
>
> Yes you remember correctly I do use Firebird SQL.
>>
>>  Could Firebird be the
>> problem (or its links to SQLAlchemy)?
>>
>
> I moved from another ORM over to SA, didn't see the problem in there and
> looking at the SA Firebird code I don't see anything which jumps out at me.
>  But frankly  the SA internals are way over my head and I hope that some of
> the SA dev's will look at this at some point.

Uhm, then I am not sure what it could be. As we are using more or less
the same SQLAlchemy configuration, I suspect there is something
different with the binding to Firebird, as SQLite is not affected in
any way. BTW, a completely off-topic question, is there any advantage
in using Firebird instead of SQLite? I am no expert in databases
things, I was just curious to know if there is something I could do to
speed up the initial loading of my database, which contains hundreds
of simulation files ordered in a tree-like structure.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/


More information about the wxpython-users mailing list