modeling-users Mailing List for Object-Relational Bridge for python (Page 27)
Status: Abandoned
Brought to you by:
sbigaret
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(19) |
Feb
(55) |
Mar
(54) |
Apr
(48) |
May
(41) |
Jun
(40) |
Jul
(156) |
Aug
(56) |
Sep
(90) |
Oct
(14) |
Nov
(41) |
Dec
(32) |
2004 |
Jan
(6) |
Feb
(57) |
Mar
(38) |
Apr
(23) |
May
(3) |
Jun
(40) |
Jul
(39) |
Aug
(82) |
Sep
(31) |
Oct
(14) |
Nov
|
Dec
(9) |
2005 |
Jan
|
Feb
(4) |
Mar
(13) |
Apr
|
May
(5) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2006 |
Jan
(1) |
Feb
(1) |
Mar
(9) |
Apr
(1) |
May
|
Jun
(1) |
Jul
(5) |
Aug
|
Sep
(5) |
Oct
(1) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Sebastien B. <sbi...@us...> - 2003-07-30 14:51:48
|
Hi, Good to know this fixed your problem. May I ask you to be a little more explicit about the version of mysql you use? --possibly off-list, if for any reasons you don't want to expose it publicly. I'm asking this because I'm trying to know whether this should be included in the core, or if I just need to add a warning (along w/ the patch) for versions<x.y.z in the User's Guide (I cannot possibly have all versions of mysql installed here to test ;). Moreover, I would like to ask you to try some sample sql statements on your db, if possible, against the tests databases (author_books and store_employees). Thanks in advance, - S=E9bastien. Yannick Gingras <yan...@sa...> wrote: > On July 29, 2003 11:09 pm, you wrote: > > As a quick workaround, try typing the same at mysql prompt, but with > > SELECT DISTINCT: does it help? >=20 > Yes ! >=20 > : ) >=20 > > If it does, you can add the following method to > > DatabaseAdaptors.MySQLAdaptorLayer.MySQLSQLExpression: > > [sniped] >=20 > Problem fixed ! >=20 > : ) >=20 > Thanks ! >=20 > --=20 > Yannick Gingras > Byte Gardener, Savoir-faire Linux inc. > (514) 276-5468 |
From: Yannick G. <yan...@sa...> - 2003-07-30 13:39:58
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On July 29, 2003 11:09 pm, you wrote: > As a quick workaround, try typing the same at mysql prompt, but with > SELECT DISTINCT: does it help? Yes ! : ) > If it does, you can add the following method to > DatabaseAdaptors.MySQLAdaptorLayer.MySQLSQLExpression: > [sniped] Problem fixed ! : ) Thanks ! =2D --=20 Yannick Gingras Byte Gardener, Savoir-faire Linux inc. (514) 276-5468 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/J8qrrhy5Fqn/MRARAhRgAJ9yxvTCCRiy/j+CGl/uWivMaBnJNACfW44d QzcVOOUTLtXWl80RAJhQnhQ=3D =3DzpIN =2D----END PGP SIGNATURE----- |
From: Sebastien B. <sbi...@us...> - 2003-07-29 23:02:48
|
I found a possible source for that bug: http://www.bitmechanic.com/mail-archives/mysql/Jul1999/1321.html http://www.bitmechanic.com/mail-archives/mysql/current/0838.html http://www.bitmechanic.com/mail-archives/mysql/current/1005.html point to release 3.22.26 and 3.23.2 where a similar bug is fixed: http://www.mysql.com/doc/en/News-3.22.26.html http://www.mysql.com/doc/en/News-3.23.2.html << Fixed range optimiser bug: SELECT * FROM table_name WHERE key_part1 >=3D const AND (key_part2 =3D const OR key_part2 =3D const). The bug was that some rows could be duplicated in the result. >> But both were released in august/sept. 1999, so unless you work w/ an old server I don't know if this applies to you. Or maybe the bug has leaked/reappeared to future versions? Note: while roaming around mysql changes/bugfixes announcements I had the feeling that bug fixes in mysql are not always clear so it's hard to tell at first sight, see for example http://www.mysql.com/doc/en/News-3.22.26.html which only says: << Fixed range optimiser bug in SELECT * FROM table_name WHERE key_part1 >=3D const AND (key_part2 =3D const OR key_part2 =3D const) >>> even if the msgs from the mysql archives at this time make it clear that this is the same bug fixed in 3.22.26 as in 3.23.2. -- S=E9bastien. Sebastien Bigaret <sbi...@us...> wrote: > Hi, >=20 > A quick answer on this: >=20 > Yannick Gingras <yan...@sa...> wrote: > > Hi, I think that something is broken with the MySQL SQL. I mean, I thi= nk > > that MySQL is broken but I have to use it and I wonder if the framework= can > > help. >=20 > > The fetch spec :=20 > >=20 > > ((codelike**) AND (isActive!=3D-255) AND (i18n.titlelike*ABC*)) > >=20 > > gives me the my 2 rows twice :=20 > >=20 > > Evaluating: SELECT t0.activity_id, t0.code, t0.enterprise_id, t0.is_act= ive=20 > > FROM ABCI18N t1 INNER JOIN ABC t0 ON ( t0.activity_id=3Dt1.activity_id = ) WHERE=20 > > (t0.code LIKE '%%' AND t0.is_active <> -255 AND t1.title LIKE '%ABC%') > > rowcount: 4 Returning: {'activityId': 1L, 'code': 'ABC009', 'enterprise= Id':=20 > > 1L, 'isActive': 1L} > > rowcount: 4 Returning: {'activityId': 1L, 'code': 'ABC009', 'enterprise= Id':=20 > > 1L, 'isActive': 1L} > > rowcount: 4 Returning: {'activityId': 2L, 'code': 'ABC123', 'enterprise= Id':=20 > > 1L, 'isActive': 1L} > > rowcount: 4 Returning: {'activityId': 2L, 'code': 'ABC123', 'enterprise= Id':=20 > > 1L, 'isActive': 1L} > >=20 > > MySQL returns 4 rows with the same select typed at the prompt. Is > > there anything that I can do to prevent the duplication ? >=20 > Okay. Just to be sure: I assume you really have no duplicates in table > ABC ;) >=20 > As a quick workaround, try typing the same at mysql prompt, but with > SELECT DISTINCT: does it help? >=20 > If it does, you can add the following method to > DatabaseAdaptors.MySQLAdaptorLayer.MySQLSQLExpression: >=20 > ------------------------------------------------------------------------ > def assembleSelectStatementWithAttributes(self, attributes, lock, quali= fier, > fetchOrder, selectString, > columnList, tableList, whereC= lause, > joinClause, orderByClause, > lockClause): > """ > """ > selectString=3DselectString or 'SELECT DISTINCT' > super=3DSQLExpression.assembleSelectStatementWithAttributes > return super(self, attributes, lock, qualifier, fetchOrder, selectStr= ing, > columnList, tableList, whereClause, joinClause,=20 > orderByClause, lockClause) > ------------------------------------------------------------------------ >=20 > Which version of mysql are you using? I cannot reproduce it here; for > example and from the test database 'AUTHOR_BOOKS', the following > statement produces the correct number of rows (with no duplicates): >=20 > select t0.id, t0.title, t0.price=20 > from WRITER t1 > INNER JOIN BOOK t0 > ON (t0.fk_writer_id=3Dt1.id) > where (t0.title like '%%' AND t0.price is NULL AND > t1.last_name like '%%'); >=20 > Mine is: mysql --version > mysql Ver 12.20 Distrib 4.0.13, for pc-linux-gnu (i686) >=20 >=20 > That's intriguing, indeed, but I've no time to investigate by > now. Does anyone know anything about this behaviour? >=20 > Last: could you try reversing the join (see below) at the mysql prompt > and report what it returns? >=20 > SELECT t0.activity_id, t0.code, t0.enterprise_id, t0.is_active=20 > FROM ABC t0 INNER JOIN ABCI18N t1 ON ( t0.activity_id=3Dt1.activity_id ) > WHERE (t0.code LIKE '%%' AND t0.is_active <> -255 AND t1.title LIKE '%AB= C%') >=20 >=20 > -- S=E9bastien. |
From: Sebastien B. <sbi...@us...> - 2003-07-29 22:19:41
|
> As a quick workaround, try typing the same at mysql prompt, but with > SELECT DISTINCT: does it help? >=20 > If it does, you can add the following method to > DatabaseAdaptors.MySQLAdaptorLayer.MySQLSQLExpression: >=20 > ------------------------------------------------------------------------ > def assembleSelectStatementWithAttributes(self, attributes, lock, quali= fier, > fetchOrder, selectString, > columnList, tableList, whereC= lause, > joinClause, orderByClause, > lockClause): > """ > """ > selectString=3DselectString or 'SELECT DISTINCT' > super=3DSQLExpression.assembleSelectStatementWithAttributes > return super(self, attributes, lock, qualifier, fetchOrder, selectStr= ing, > columnList, tableList, whereClause, joinClause,=20 > orderByClause, lockClause) > ------------------------------------------------------------------------ Sorry, I meant: selectString=3DselectString or 'SELECT DISTINCT ' ^ with a trailing whitespace after DISTINCT. -- S=E9bastien. |
From: Sebastien B. <sbi...@us...> - 2003-07-29 21:37:01
|
Hi, A quick answer on this: Yannick Gingras <yan...@sa...> wrote: > Hi, I think that something is broken with the MySQL SQL. I mean, I think > that MySQL is broken but I have to use it and I wonder if the framework c= an > help. > The fetch spec :=20 >=20 > ((codelike**) AND (isActive!=3D-255) AND (i18n.titlelike*ABC*)) >=20 > gives me the my 2 rows twice :=20 >=20 > Evaluating: SELECT t0.activity_id, t0.code, t0.enterprise_id, t0.is_activ= e=20 > FROM ABCI18N t1 INNER JOIN ABC t0 ON ( t0.activity_id=3Dt1.activity_id ) = WHERE=20 > (t0.code LIKE '%%' AND t0.is_active <> -255 AND t1.title LIKE '%ABC%') > rowcount: 4 Returning: {'activityId': 1L, 'code': 'ABC009', 'enterpriseId= ':=20 > 1L, 'isActive': 1L} > rowcount: 4 Returning: {'activityId': 1L, 'code': 'ABC009', 'enterpriseId= ':=20 > 1L, 'isActive': 1L} > rowcount: 4 Returning: {'activityId': 2L, 'code': 'ABC123', 'enterpriseId= ':=20 > 1L, 'isActive': 1L} > rowcount: 4 Returning: {'activityId': 2L, 'code': 'ABC123', 'enterpriseId= ':=20 > 1L, 'isActive': 1L} >=20 > MySQL returns 4 rows with the same select typed at the prompt. Is > there anything that I can do to prevent the duplication ? Okay. Just to be sure: I assume you really have no duplicates in table ABC ;) As a quick workaround, try typing the same at mysql prompt, but with SELECT DISTINCT: does it help? If it does, you can add the following method to DatabaseAdaptors.MySQLAdaptorLayer.MySQLSQLExpression: ------------------------------------------------------------------------ def assembleSelectStatementWithAttributes(self, attributes, lock, qualifi= er, fetchOrder, selectString, columnList, tableList, whereCla= use, joinClause, orderByClause, lockClause): """ """ selectString=3DselectString or 'SELECT DISTINCT' super=3DSQLExpression.assembleSelectStatementWithAttributes return super(self, attributes, lock, qualifier, fetchOrder, selectStrin= g, columnList, tableList, whereClause, joinClause,=20 orderByClause, lockClause) ------------------------------------------------------------------------ Which version of mysql are you using? I cannot reproduce it here; for example and from the test database 'AUTHOR_BOOKS', the following statement produces the correct number of rows (with no duplicates): select t0.id, t0.title, t0.price=20 from WRITER t1 INNER JOIN BOOK t0 ON (t0.fk_writer_id=3Dt1.id) where (t0.title like '%%' AND t0.price is NULL AND t1.last_name like '%%'); Mine is: mysql --version mysql Ver 12.20 Distrib 4.0.13, for pc-linux-gnu (i686) That's intriguing, indeed, but I've no time to investigate by now. Does anyone know anything about this behaviour? Last: could you try reversing the join (see below) at the mysql prompt and report what it returns? SELECT t0.activity_id, t0.code, t0.enterprise_id, t0.is_active=20 FROM ABC t0 INNER JOIN ABCI18N t1 ON ( t0.activity_id=3Dt1.activity_id ) WHERE (t0.code LIKE '%%' AND t0.is_active <> -255 AND t1.title LIKE '%ABC%= ') -- S=E9bastien. |
From: Yannick G. <yan...@sa...> - 2003-07-29 20:21:53
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I think that something is broken with the MySQL SQL. I mean, I think t= hat=20 MySQL is broken but I have to use it and I wonder if the framework can help= =2E =20 The fetch spec :=20 ((codelike**) AND (isActive!=3D-255) AND (i18n.titlelike*ABC*)) gives me the my 2 rows twice :=20 Evaluating: SELECT t0.activity_id, t0.code, t0.enterprise_id, t0.is_active= =20 =46ROM ABCI18N t1 INNER JOIN ABC t0 ON ( t0.activity_id=3Dt1.activity_id ) = WHERE=20 (t0.code LIKE '%%' AND t0.is_active <> -255 AND t1.title LIKE '%ABC%') rowcount: 4 Returning: {'activityId': 1L, 'code': 'ABC009', 'enterpriseId':= =20 1L, 'isActive': 1L} rowcount: 4 Returning: {'activityId': 1L, 'code': 'ABC009', 'enterpriseId':= =20 1L, 'isActive': 1L} rowcount: 4 Returning: {'activityId': 2L, 'code': 'ABC123', 'enterpriseId':= =20 1L, 'isActive': 1L} rowcount: 4 Returning: {'activityId': 2L, 'code': 'ABC123', 'enterpriseId':= =20 1L, 'isActive': 1L} MySQL returns 4 rows with the same select typed at the prompt. Is there anything that I can do to prevent the duplication ? Thanks in advance ! =2D --=20 Yannick Gingras Byte Gardener, Savoir-faire Linux inc. (514) 276-5468 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/JtAjrhy5Fqn/MRARAlMjAJ0eaFrARN9Z4CZtciN5z16eHNsNdgCdFIXT n+7h7wwmFLECQsBBkFo7ENs=3D =3DNxDq =2D----END PGP SIGNATURE----- |
From: Sebastien B. <sbi...@us...> - 2003-07-29 19:45:35
|
Hi, Yannick Gingras <yan...@sa...> wrote: > Hi,=20 > you may experience a SQL Error when using QualifierOperatorIn with > long values on 0.9-pre-11. The following patch fix this problem : Oh my, when reading your message I knew this sounded like a deja-vu... After checking the archives I realized you already fixed that in a message dated the 15th of June. Then it leaked out of my brain :/ Thanks for reporting, your patch will be integrated in the next version (I've submitted ticket #779775 to sf's bug tracker so that I won't forget this time). -- S=E9bastien. > --- SQLExpression.py.old 2003-07-29 14:29:18.000000000 -0400 > +++ SQLExpression.py 2003-07-29 14:29:21.000000000 -0400 > @@ -1232,7 +1232,7 @@ > if len(aList)=3D=3D1: > return '(%s)'%aList[0] > else: > return str(tuple(aList)) > + return "(%s)" % ", ".join(map(str, aList)) >=20 > def sqlStringForNegatedQualifier(self, aQualifier): > """ |
From: Yannick G. <yan...@sa...> - 2003-07-29 18:39:30
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi,=20 you may experience a SQL Error when using QualifierOperatorIn with long values on 0.9-pre-11. The following patch fix this problem : =2D --- SQLExpression.py.old 2003-07-29 14:29:18.000000000 -0400 +++ SQLExpression.py 2003-07-29 14:29:21.000000000 -0400 @@ -1232,7 +1232,7 @@ if len(aList)=3D=3D1: return '(%s)'%aList[0] else: =2D - return str(tuple(aList)) + return "(%s)" % ", ".join(map(str, aList)) def sqlStringForNegatedQualifier(self, aQualifier): """ =2D --=20 Yannick Gingras Byte Gardener, Savoir-faire Linux inc. (514) 276-5468 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/Jr9grhy5Fqn/MRARAgEmAKCDhIvT3jz6LeipOEzHQ7wpKMTOfQCfVrva wsBM4vKj31F1dgilbCA4EiQ=3D =3DzpBZ =2D----END PGP SIGNATURE----- |
From: Sebastien B. <sbi...@us...> - 2003-07-28 17:29:29
|
Hi, Since this got no further comments in almost two weeks I'll let the change happen in the next release. --> CustomObject.snapshot will return a to-many fault (AccessArrayFaultHandler) instead of None when a key holds a faulted sequence of objects, instead of None. -- S=E9bastien. > Working on the ability to fetch raw rows, I incidentally found out > that the snapshot method is not behaving the way I thought it was > (this case was not tested and left undetermined). >=20 > The current behaviour is (using the StoreEmployees model & test data): >=20 > >>> ec=3DEditingContext() > >>> circus=3Dec.fetch('Store', 'corporateName =3D=3D "Flying Circus"')[0] > >>> circus.getEmployees().isFault() > 1 > >>> circus.snapshot() > {'corporateName': 'Flying Circus', 'employees': None} > >>> len(circus.getEmployees()) # clears the fault and fetches the array > 3 > >>> pprint.pprint(circus.snapshot()) > {'corporateName': 'Flying Circus', > 'employees': [<Modeling.GlobalID.KeyGlobalID instance at 0x8539884>, > <Modeling.GlobalID.KeyGlobalID instance at 0x85271f4>, > <Modeling.GlobalID.KeyGlobalID instance at 0x851ccfc>]} >=20 >=20 > As you can see, when the array of 'employees' is faulted (it has not > been fetched yet), it appears as None in the snapshot. It seems quite > weird to me. I'd highly prefer to return something like this: >=20 >=20 > >>> pprint.pprint(circus.snapshot()) > {'corporateName': 'Flying Circus', > 'employees': <Modeling.FaultHandler.AccessArrayFaultHandler instance at = 0x8539034>} >=20 > I'll probably change this, but I'd like to get your opinion on that, > especially I'd like to know how you handle this if you're already > using CustomObject.snapshot() in your own projects, and if such a > modification could fit your needs. |
From: Sebastien B. <sbi...@us...> - 2003-07-28 14:44:45
|
While the bench script is not completely finished for now, I can give some performance indications for this release. For the benchs implemented by now, we have: > ./compare_bench.py perf.0.9pre10 perf.0.9pre11=20 {'bench_addObj_toMany': ('428.705 usec', '196.659 usec', '2.18'), 'bench_addObj_toOne': ('950.431 usec', '449.753 usec', '2.11'), 'bench_fetch_persons': ('6.056 s', '5.384 s', '1.12'), 'bench_fetch_raw_row': ('10.672 ms', '11.005 ms', '0.97'), 'bench_fetch_raw_rows': ('550.871 ms', '526.122 ms', '1.05'), 'bench_fetch_raw_rows_all_modified': ('1.803 s', '1.432 s', '1.26')} (reported time is for python2.2, no optimization, with model caching enabled for 0.9pre11 --new in this release) The performance gains are quite similar w/ python -O: > ./compare_bench.py perf.0.9pre10.opt perf.0.9pre11.opt=20 {'bench_addObj_toMany': ('424.029 usec', '190.539 usec', '2.23'), 'bench_addObj_toOne': ('951.976 usec', '424.874 usec', '2.24'), 'bench_fetch_persons': ('5.627 s', '5.030 s', '1.12'), 'bench_fetch_raw_row': ('10.570 ms', '10.579 ms', '1.00'), 'bench_fetch_raw_rows': ('555.589 ms', '521.151 ms', '1.07'), 'bench_fetch_raw_rows_all_modified': ('1.800 s', '1.452 s', '1.24')} Signification: The above lines share the same format: 'bench_name': (time1, time2, gain=3Dtime1/time2),=20 where times are as observed on my machine, and benchs' names are: - bench_addObj_toMany: addObjectToBothSidesOfRelationshipWithKey() on a to-many relationship =20=20=20=20 - bench_addObj_toOne: addObjectToBothSidesOfRelationshipWithKey() on a to-one relationship =20=20=20=20 - bench_fetch_persons: fetch 5000 simple objects (1 string attribute, 1 PK, 1 FK hence 1 to-one fault created for each object) =20=20=20=20 - bench_fetch_raw_row: fetch one single row =20=20=20=20 - bench_fetch_raw_rows: fetch 5000 raw rows (same simple objects/ rows than above) =20=20=20=20 - bench_fetch_raw_rows_all_modified: fetch the same 5000 raw rows, where the corresponding objects were already fetched in the EC and are all modified (this is the worst situation for fetching raw rows) Rq.: Fetching seems to be equally fast. In fact, it was slowed down a little by the extra work needed to support to-many relationships w/o inverse. This loss of performance is then regained by caching models at runtime. The performance boost observed for addObjectToBothSides... is mostly due to model's properties caching --plus some "refactoring effect", but only for a small part of the perf gain. I'd like to thank Yannick in particular here, for his numerous feedbacks and suggestions about the observed performance bottlenecks in the framework. -- S=E9bastien. |
From: Sebastien B. <sbi...@us...> - 2003-07-28 12:03:36
|
Hi all, 0.9pre11 has just been released! Main changes are: - the constraint on to-many relationship for which an inverse to-one relationship had to be defined has been dropped, it is now possible to define a to-many relationship with no inverse. Special note: you should be very careful about this if you use CustomObject.snapshot_raw() or if you defined FK as class properties. Documenation for particular issues in this configuration is forthcoming; if you need it, please ask for it here. - A caching mechanism is now available for models at runtime, improving the general performance of the core --refer to appendix A.1 in the User's Guide for details: http://modeling.sf.net/UserGuide/env-vars-core.html - This release also includes some bug fixes, including: the ability to fetch raw '?' and '*' in "like" qualifiers (ticket #776592), RelationshipManipulation methods misbehaving when manipulating sub-entities (inheritance issue, ticket #776996) - Manipulation of custom data types, that was discussed here for assigning FixedPoint instances to an attribute, is now documented. See section 9: http://modeling.sf.net/UserGuide/attribute-custom-type.html Regards, -- S=E9bastien. PS: Documentation for PyModels is not finished yet. ------------------------------------------------------------------------ 0.9-pre-11 (2003/07/28) ----------------------- * Removed the constraint on to-many relationships for which an inverse to-one relationship had to be defined. Details: recordChangesInEditingContext() refactored, recordUpdateForObject() implemented, model StoreEmployees changed. * Added Relationship.anyInverseRelationship() --plus entity Holidays in test model StoreEmployees, with a toMany rel. Employee-->Holidays having no inverse. This is the first step towards the removal of the constraint on to-many relationships that should have an inverse toOne rel. for the moment being. * Fixed bug #776996: RelationshipManipulation methods misbehaving w/ inheritance. Implied fixing: Relationship.inverseRelationship(). Also added: entity.parentEntities() * Fixed bug #776592: was impossible to add raw '*' and '?' characters in a LIKE statement * Simple methods for models, entities, attributes, relationships and ClassDescriptions can now be automatically cached. This speeds up operations where model introspection is needed (when saving changes, wh= en using RelationshipManipulation interface, etc.). See Appendix A.1, "Environment variables / Core" in the User's Guide for details. * Module RelationshipManipulation has been optimized and is now about 1.2x faster (2x faster with caching of models and class descriptions, see above) * Model, Entity, Attribute, Relationship, Join: replaced 'Unimplemented' exception with NotImplementedError * Added documentation: handling custom types for attributes (2003/07/21) ------------------------------------------------------------------------ |
From: Yannick G. <yan...@sa...> - 2003-07-25 17:41:00
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On July 25, 2003 12:24 pm, you wrote: > Okay. Just curious: the sql dump stores the sequences (support for PK > generation) as well, or do you restore it by hand? I'm on MySQL... > Oh, well, and last note about this: PK generation is not completely > portable; for example, on oracle & postgresql we use sequences, while t= he > mysql adaptor uses a specific table. =2E..so the sequences is a table: dumped and restored in the process =2D --=20 Yannick Gingras Byte Gardener, Savoir-faire Linux inc. (514) 276-5468 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/IWuprhy5Fqn/MRARAgkgAJ0eho48Hjv8pxxSRoklqe5vDjvL4QCfa13A +uNcBxfgTIt/vMoPBN2R4bw=3D =3DoCGk =2D----END PGP SIGNATURE----- |
From: Sebastien B. <sbi...@us...> - 2003-07-25 16:24:51
|
Yannick Gingras <yan...@sa...> writes: > On July 25, 2003 11:48 am, Sebastien Bigaret wrote: > > Was this meaningful, or do you still think you need to be able to > > provide your own PKs? >=20 > I switched to raw SQL dump... >=20 > Easier faster... Okay. Just curious: the sql dump stores the sequences (support for PK generation) as well, or do you restore it by hand? Oh, well, and last note about this: PK generation is not completely portable; for example, on oracle & postgresql we use sequences, while the mysql adaptor uses a specific table. -- S=E9bastien. |
From: Yannick G. <yan...@sa...> - 2003-07-25 16:08:07
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On July 25, 2003 11:48 am, Sebastien Bigaret wrote: > Was this meaningful, or do you still think you need to be able to > provide your own PKs? I switched to raw SQL dump... Easier faster... But this EC serialization thing it still of interest to me : ) =2D --=20 Yannick Gingras Byte Gardener, Savoir-faire Linux inc. (514) 276-5468 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/IVXkrhy5Fqn/MRARAuJhAJ9YG+O1usppaLQknPwQ1VmJR+tIKgCfZMq1 0YwpRHyV6hlqXyriY8k5/yg=3D =3DYSTO =2D----END PGP SIGNATURE----- |
From: Sebastien B. <sbi...@us...> - 2003-07-25 15:48:33
|
Was this meaningful, or do you still think you need to be able to provide your own PKs? Sebastien Bigaret <sbi...@us...> wrote: > Okay, so: >=20 > 1. when you're saving the db into xml, you want to avoid saving objects= in > relations (I presume that's why 'i18n' e.g. is hard-coded), >=20 > 2. when restoring, you have to find back the objects in relations. >=20 > About 1: I saw you're using CustomObject.snapshot(). Note that since > fetchRawRow() exists, you also have a method CustomObject.snapshot_raw() > at hand which returns the row corresponding to the object (and this one > is exactly the same one than the one you'd get with fetch and parameter > rawRows=3D1). So, as expected, you get the PK and the FKs defined for the > corresp. entity, *no matter* whether they are class properties or not. >=20 > (And yes, it should be documented :) >=20 > Now for restoring, I must be possible to do something like this: >=20 > - initialize and populate each object, store them in a dictionary with > something like=20 >=20 > rootEntityName=3Dentity.rootEntity().name() #this makes it easier > #if you use inheritance > d[rootEntityName+'_%i'%pk]=3Dobject >=20 > - then iterate on your objects and fill the relations, just as you do, > except that you'll avoid the slow xpath query. Instead, you'll > iterate on your i18ns and find the corresponding master object with > a simple lookup in the dictionary, because the master will be: >=20 > rootEntityName_master=3D... > master=3Dd[rootEntityName_master+'_%i'%i18n._fk_master] >=20 > given that the fk is stored in the i18n._fk_master >=20 > > So skiping PKs would be much more simple >=20 > In fact, your problem here is not exactly to set a PK you generate > yourself, but to match an object's FK w/ an other object's PK, which > is not exactly the same pb. and cannot be easily solved. >=20 > > but having the framework > > doing the dump and restoration would be even beter. I do the dump > > like this (phpMyAdmin is full Latin-1) : >=20 > In fact, yes, this would be better, for example with serialization of > EditingContext. Not done however... >=20 > Last, I don't know why you insist on dumping/restoring your db w/ the > framework, but that's not the most efficient way of doing this, is it?-) >=20 > Maybe you should consider dumping and restoring raw sql (postgresql can > dump a whole database in a text file). In this case, the only thing > you'll have to take care of wrt the framework is that sequences > supporting PK generation (you're using postgresql, right?) get the right > value before trying to insert new objects (the sequence should start at > max(id)+1 for a given table, or, if you're using inheritance, to the > max(id) of the different tables involved in an inheritance tree --there > is one and only one sequence used for generating the pks per root > entity). >=20 >=20 > -- S=E9bastien. |
From: Jerome K. <Jer...@fi...> - 2003-07-25 01:25:42
|
I don't know if lot of us use Zope .. but last time i speak w/ S=E9bastien, we talk about APE and CMFTypes ( now Archetypes). While this things are pretty interesting the main trouble is the lack on documentation. Tonight (as I'm reading DC weblog ) i found this :=20 http://plone.sourceforge.net/archetypes/sqlstorage-howto.html#archetypes-= versus-other-relational-database-systems I thinks this could interest some people in so I post this here.=20 /Enjoy ...=20 |
From: Sebastien B. <sbi...@us...> - 2003-07-24 16:57:41
|
End of emergency :) Ticket #776996 (RelationshipManipulation methods misbehaving w/ inheritance) is now fixed; if you need it you'll find the patch on sf.net: https://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D776996&group_= id=3D58935&atid=3D489335 It has been put into cvs and will be integrated in the next release. Regards, -- S=E9bastien. |
From: Sebastien B. <sbi...@us...> - 2003-07-24 15:39:22
|
> While working on bug #775082 (class properties FKs do not get their > new value after save), I realized that RelationshipManipulation > methods (such as addObjectToBothSidesOfRelationshipWithKey()) do not > behave as expected in an inheritance environment. [...] > I've submitted bug report #776996. This is considered a high-priority > issue. Note: AFAIK this has absolutely no impact on the core itself, you can run into it if, and only if, you use RelationshipManipulation methods on objects involved in a inheritance tree. -- S=E9bastien. |
From: Sebastien B. <sbi...@us...> - 2003-07-24 15:19:05
|
Hi all, While working on bug #775082 (class properties FKs do not get their new value after save), I realized that RelationshipManipulation methods (such as addObjectToBothSidesOfRelationshipWithKey()) do not behave as expected in an inheritance environment. An example will describe the pb. better than words: model:=20 Address <<-------> Employee and Executive inherits from Employee Tests: emp=3DEmployee() a=3DAddress() emp.addObjectToBothSidesOfRelationshipWithKey(a, 'toAddresses') self.failUnless(a in emp.getToAddresses()) self.failUnless(emp =3D=3D a.getToEmployee()) ex=3DExecutive() a=3DAddress() ex.addObjectToBothSidesOfRelationshipWithKey(a, 'toAddresses') self.failUnless(a in ex.getToAddresses()) self.failUnless(ex =3D=3D a.getToEmployee()) ## FAILS!! I've submitted bug report #776996. This is considered a high-priority issue. -- S=E9bastien. |
From: Yannick G. <yan...@sa...> - 2003-07-24 13:25:12
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On July 24, 2003 07:53 am, Sebastien Bigaret wrote: > The patch attached to the bug report solves the problem. It is > integrated in CVS and will be in next release. Now you can say: Woohoo ! : ) =2D --=20 Yannick Gingras Byte Gardener, Savoir-faire Linux inc. (514) 276-5468 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/H942rhy5Fqn/MRARApPMAJ4mSQbN5ONSwLgKyEbcoEjxSeFAdACgipO4 Sjs5eD1kXcEQhRfsi6Syk70=3D =3D34QW =2D----END PGP SIGNATURE----- |
From: Sebastien B. <sbi...@us...> - 2003-07-24 11:58:17
|
Hi, Federico Di Gregorio, maintainer of psycopg, asked today for suggestions <<about unicode strings in postgresql and client conversions>>. http://lists.initd.org/pipermail/psycopg/2003-July/002171.html Those of you using unicode w/ psycopg may want to follow/participate to the discussion there. -- S=E9bastien. |
From: Sebastien B. <sbi...@us...> - 2003-07-24 11:53:30
|
Yannick Gingras <yan...@sa...> wrote: > Is there a way to fetch those records that use "???" ? >=20 > Something like "\\?\\?\\?" but that actualy works... >=20 > Thanks in advance! Just escape it :] --> See bug item #776592 added after your request. https://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D776592&group_= id=3D58935&atid=3D489335 It was in fact impossible to fetch a pattern containing raw '?' or '*'; thanks for reporting. The patch attached to the bug report solves the problem. It is integrated in CVS and will be in next release. Now you can say: ec.fetch('Book', 'title like "abc\?d"') See also: test_EditingContext_Global.test_23_fetch_star_and_interrogation_mark_chars() As a consequence, however, the following sequences of two characters cannot be specified in a fetch qualifier: '\?' and '\*'. Hopefully this won't annoy anyone... -- S=E9bastien. |
From: Yannick G. <yan...@sa...> - 2003-07-23 21:17:12
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Is there a way to fetch those records that use "???" ? Something like "\\?\\?\\?" but that actualy works... Thanks in advance! =2D --=20 Yannick Gingras Byte Gardener, Savoir-faire Linux inc. (514) 276-5468 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/HvtTrhy5Fqn/MRARAhRYAJ9762bUWXBK8abNJp+ssMfu3138fwCfRoDE LVlGQHlPxXvYn1O9hiofo14=3D =3DyRud =2D----END PGP SIGNATURE----- |
From: Sebastien B. <sbi...@us...> - 2003-07-23 20:37:10
|
Yannick Gingras <yan...@sa...> wrote: > On July 23, 2003 02:53 pm, Jerome Kerdreux wrote: > > Hum It's work fine except that after I post something > > in a thread the default reply to will be the list not the > > user . So it works for me but this will break the default > > policy . >=20 > Noop, your reply-to is kept to yourself, Mailman probably restore > it... Oh, ok, that's what you meant Jerome. No need to worry, in fact the reply-to is just added to your local copy of the mail, but not copied back in your replies, so others are not seeing this at all (mailman does not play with it at all) > KMail has an insant filter for this : right-click on a message from the > mailing list -> create folter on mailing list -> action -> set Reply-To > Header -> modeling-users... Good to know, thanks, I'll probably add this hint too. Cheers, -- S=E9bastien. |
From: Sebastien B. <sbi...@us...> - 2003-07-23 19:42:12
|
Jerome Kerdreux <Jer...@fi...> wrote: > Hum It's work fine except that after I post something > in a thread the default reply to will be the list not the > user . So it works for me but this will break the default > policy . Well, unless I misunderstand you that's exactly what it was intended for :) Since some of you complained about the Reply-To not being set for the list, this directive for procmail allows them to choose to add it on their own, and, yes, to break the default policy on their own configuration. So since it's impossible to conciliate the pro- and the anti-reply-to, at least with this, one can choose on which side one stands! Thanks for testing. I'll add this to the welcome message of the list. -- S=E9bastien. |