I have a large set of database logics in python. All of them are in similar forms like this:


>>> inven = Inventory(dbconnection)
>>> inven.getBillOfMaterial(itemId='10020')
[('1134', 12), ('23522', 32)]

I'm now investigating the best way to to publish them via zope3.
I need some suggestion on these question.

1. How can I get the "dbconection" ? My database is Microsoft SQL Server. My dbapi is adodbapi.
Should I study gadflyda code and try to implement adodbapida for this ?

2. Since zope.app.rdb.ZopeDatabaseAdapter is to be used as a local service, that mean there will be one instance per thread like other zodb object; is that correct ? Will the connection be flushed away
after a transaction finished ? If yes, how to avoid that ?

3. What I should do in case that sometime my database might be unavailable, and I want my connection to be reestablished where it come back. How can I detect those events and reestablish the connection when the certain type of exception was raised (like connection closed by network error)


_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to