Matthew T. Kromer wrote: > Geir Bækholt wrote: > >> Hello Dario, >> Just noticed behaviour similar to this a couple of days ago , but >> haven't had the time to file a report on it.. - We managed to narrow >> it down a bit , tho' : >> >> In our installation ; Zope silently restarted , quite quickly , and >> almost unnoticeable to our editors. >> This was triggered either when we passed one of the >> oracle-date-objects returned by DCO2 to DateTime(), or when we >> believed them to be DateTime objects and tried to run DateTime methods >> on them... >> > So what you REALLY want is the ZOracleDA to promote the weakling > dco2.DateTime objects to full Zope DateTime objects. > > Aha! > > I think that's doable in short order.
In fact, here's the simple patch (only the last bit is really necessary, but as long as I was looking at it I tweaked the listtype to be a pseudo-constant as an argument. I've checked it in to CVS too :) Index: db.py =================================================================== RCS file: /cvs-repository/Products/DCOracle2/db.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- db.py 14 Sep 2001 15:11:19 -0000 1.8 +++ db.py 2 Oct 2001 21:13:58 -0000 1.9 @@ -83,8 +83,8 @@ # ############################################################################## -'''$Id: db.py,v 1.8 2001/09/14 15:11:19 matt Exp $''' -__version__='$Revision: 1.8 $'[11:-2] +'''$Id: db.py,v 1.9 2001/10/02 21:13:58 matt Exp $''' +__version__='$Revision: 1.9 $'[11:-2] import DCOracle2, DateTime #DCOracle.dbi.dbiDate=DateTime.DateTime @@ -230,12 +230,14 @@ # # Do we get tuples back in results? should just be lists # - def _lobConvert(self, result): + def _lobConvert(self, result, listtype=type([])): for i in xrange(len(result)): t = type(result[i]) - if t == type([]): self._lobConvert(result[i]) + if t == listtype: self._lobConvert(result[i]) elif t == DCOracle2.dco2.LobLocatorType: result[i] = LobLocator(result[i]) + elif t == DCOracle2.dco2.OracleDateType: + result[i] = DateTime.DateTime(float(result[i])) # Added for ChrisM (11/13/2000 MTK) def commit_sub(self, *arg, **kw): _______________________________________________ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )