modeling-users Mailing List for Object-Relational Bridge for python (Page 3)
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...> - 2005-03-05 17:20:02
|
Hi, Sorry for the late answer. Wara Songkran <war...@gm...> wrote: > Hi >=20 > I've try to test insertion Ojbect with refference to the others [...] > ec.setAutoInsertion(True) > s =3D Staff() > t =3D Task() > s.addToTasks(t) > ec.insert(s) > ec.saveChanges() >=20 > the staff foreign key in task row is Null. but if I execute > t.setStaff(s). It's work normally. >=20 >=20 > do I have to call t.setStaff(s) explicitly In short: yes, you do. As a general rule, you are responsible for keeping your object graph consistent. Now a bit longer: ec's autoInsertion feature only takes care of calling ec.insert() on the objects that are: - not inserted in the ec yet, - and which are in relation to objects that are already under the control of an EC However, the ec does not play with your relations , it always assumes that the object graph is as the developper wants it to be. If the association is bidirectional, you have to set both relations. Now you can also delegate the work to addObjectToBothSidesOfRelationshipWithKey(), see http://modeling.sf.net/UserGuide/customobject-relationshipmanipulation.html In your case, you'll write:=20 s.addObjectToBothSidesOfRelationshipWithKey(t, 'tasks') or t.addObjectToBothSidesOfRelationshipWithKey(s,, 'staff') -- S=E9bastien. Wara Songkran <war...@gm...> wrote: > Hi >=20 > I've try to test insertion Ojbect with refference to the others >=20 > My Entities are=20 >=20 > Entity('Staff', > properties=3D[ APrimaryKey('id', isClassProperty=3D0, isRequired= =3D1), > AString('firstName', isRequired=3D1, > columnName=3D'firstName'), > AString('lastName', isRequired=3D1, columnName=3D'l= astName'), > ], > ), > Entity('Task', > properties=3D[ APrimaryKey('id', isClassProperty=3D0, isRequire= d=3D1), > ADateTime('startTime', columnName=3D'startTime', > externalType=3D'datetime'), > ADateTime('completeTime', > columnName=3D'completeTime', externalType=3D'datetime'), > AString('isCompleted',doc=3D'yes or no') > ], > ), >=20 > and my association is >=20 > Association('Task', 'Staff',=20 > relations=3D['staff', 'tasks']), >=20 > and when i execute >=20 > ec.setAutoInsertion(True) > s =3D Staff() > t =3D Task() > s.addToTasks(t) > ec.insert(s) > ec.saveChanges() >=20 > the staff foreign key in task row is Null. but if I execute > t.setStaff(s). It's work normally. >=20 >=20 > do I have to call t.setStaff(s) explicitly >=20 > Regards > Wara Songkran |
From: Sebastien B. <sbi...@us...> - 2005-03-05 15:58:27
|
Hi John, John Lenton <jl...@gm...> wrote: > I have a table that has ~28k rows, and doing a simple >=20 > ec.delete(obj) > ec.saveChanges() >=20 > takes about 60 seconds. This is for a web app, so the delay is way > beyond what a user would find reasonable. Is there any way to speed > this up? > --=20 > John Lenton (jl...@gm...) -- Random fortune: > Don't anthropomorphise computers and cars, They hate that. That's waaaaayyy to slow, even for a regular app. Before investigating any further, could you integrate the following patch and send the result of ec.currentStateSummary() just before the saveChanges()? I'd like to see whether this is actually the only change or not, and how much objects are handled by the ec. Even better, if you can, change ec.delete/ec.saveChange into: ec.delete(obj) print ec.currentStateSummary() # print it or log it if this is a web app ec.processRecentChanges() print ec.currentStateSummary() ec.saveChanges() print ec.currentStateSummary() -- S=E9bastien. |
From: John L. <jl...@gm...> - 2005-03-05 15:36:26
|
On 05 Mar 2005 16:31:38 +0100, Sebastien Bigaret <sbi...@us...> wrote: > > That's waaaaayyy to slow, even for a regular app. Before investigating > any further, could you integrate the following patch and send the result > of ec.currentStateSummary() just before the saveChanges()? I'm guessing you forgot the patch? -- John Lenton (jl...@gm...) -- Random fortune: Don't anthropomorphise computers and cars, They hate that. |
From: John L. <jl...@gm...> - 2005-03-04 20:38:24
|
I have a table that has ~28k rows, and doing a simple ec.delete(obj) ec.saveChanges() takes about 60 seconds. This is for a web app, so the delay is way beyond what a user would find reasonable. Is there any way to speed this up? -- John Lenton (jl...@gm...) -- Random fortune: Don't anthropomorphise computers and cars, They hate that. |
From: Wara S. <war...@gm...> - 2005-02-25 09:35:49
|
Hi I've try to test insertion Ojbect with refference to the others My Entities are Entity('Staff', properties=[ APrimaryKey('id', isClassProperty=0, isRequired=1), AString('firstName', isRequired=1, columnName='firstName'), AString('lastName', isRequired=1, columnName='lastName'), ], ), Entity('Task', properties=[ APrimaryKey('id', isClassProperty=0, isRequired=1), ADateTime('startTime', columnName='startTime', externalType='datetime'), ADateTime('completeTime', columnName='completeTime', externalType='datetime'), AString('isCompleted',doc='yes or no') ], ), and my association is Association('Task', 'Staff', relations=['staff', 'tasks']), and when i execute ec.setAutoInsertion(True) s = Staff() t = Task() s.addToTasks(t) ec.insert(s) ec.saveChanges() the staff foreign key in task row is Null. but if I execute t.setStaff(s). It's work normally. do I have to call t.setStaff(s) explicitly Regards Wara Songkran |
From: Wara S. <war...@gm...> - 2005-02-17 18:19:59
|
On 17 Feb 2005 12:34:43 +0100, Sebastien Bigaret <sbi...@us...> wrote: >=20 > Hi, >=20 > Wara Songkran <war...@gm...> wrote: > > I've try to create one-to-one association from table Task to Supplier b= y define > > > > model.association =3D [ > > Association('Task', 'Supplier',multiplicity=3D[ [0, 1], [0, 1] ]) > > ] > > > > but the error said > > > > ValueError: invalid multiplicity dst->src: should be toMany > > > > I've also apply the patch from > > http://sourceforge.net/mailarchive/message.php?msg_id=3D9401573 > > > > Did I done something wrong? >=20 > The problem is that one-to-one relationships are still not supported > out of the box, at least not the way one think they should be :/ >=20 > For the moment one-to-one rels. should be modeled as one-to-many > (http://modeling.sourceforge.net/UserGuide/design-rels.html) >=20 > Back to your example, your model becomes:: >=20 > model.association =3D [ > ## this is in fact a one-to-one modeled as a one-to-many, > ## class 'Supplier' defines getTask() and setTask() > Association('Task', 'Supplier',multiplicity=3D[ [0, 1], [0, None] ], > relations=3D['supplier', 'tasks'] ) > ] >=20 > and then you add to the class Supplier the following code:: >=20 > def validateTasks(self, aValue): > """ > ``tasks`` is a to-one relationship modeled as a to-many (inverse of > the to-one rel ``Task.supplier``): it is valid iff it has no more > than one element >=20 > :exception Modeling.Validation.ValidationException: if more than one > task is registered > :see: `getTask()`, `setTask()` > """ > # see http://modeling.sf.net/UserGuide/customobject-validation-by-key= .html > # subsection 3.3.2.2. > from Modeling import Validation > if len(self.getTasks())>1: > raise Validation.ValidationException > return >=20 > def getTask(self): > if self.getTasks(): > return self.getTasks()[0] > return None >=20 > def setTask(self, task): > if self.getTask(): > self.removeFromTasks(self.getTask()) > self.addToTasks(task) >=20 > # you can also define the corresponding property: > task =3D property(getTask, setTask, None, "to-one relationship to Task") >=20 > Additional note: with this definition you'll have a foreign key in entity > 'Task' pointing to the primary key in entity 'Supplier'. It seems > reasonable, but in case you want the inverse, swap tasks and supplier in= the > association's definition and define get/setSupplier() in class Task. >=20 > Regards, >=20 > -- S=E9bastien. >=20 >=20 Thank for your reseponse. Now I know more limitation of Modeling. I'm developing a relational <--> xml mapping (relational <--> object <--> xml) using your framework and EaseXML http://xmlobject.base-art.net/ (nothing serius just a part of my school project) Do you have any suggestion. Regard Wara Songkran |
From: Sebastien B. <sbi...@us...> - 2005-02-17 11:37:47
|
Hi, Wara Songkran <war...@gm...> wrote: > I've try to create one-to-one association from table Task to Supplier by = define >=20 > model.association =3D [ > Association('Task', 'Supplier',multiplicity=3D[ [0, 1], [0, 1] ]) > ] >=20 > but the error said=20 >=20 > ValueError: invalid multiplicity dst->src: should be toMany >=20 > I've also apply the patch from > http://sourceforge.net/mailarchive/message.php?msg_id=3D9401573 >=20 > Did I done something wrong? The problem is that one-to-one relationships are still not supported out of the box, at least not the way one think they should be :/ For the moment one-to-one rels. should be modeled as one-to-many (http://modeling.sourceforge.net/UserGuide/design-rels.html) Back to your example, your model becomes:: model.association =3D [ ## this is in fact a one-to-one modeled as a one-to-many, ## class 'Supplier' defines getTask() and setTask() Association('Task', 'Supplier',multiplicity=3D[ [0, 1], [0, None] ], relations=3D['supplier', 'tasks'] ) ] and then you add to the class Supplier the following code:: =20=20 def validateTasks(self, aValue): """ ``tasks`` is a to-one relationship modeled as a to-many (inverse of the to-one rel ``Task.supplier``): it is valid iff it has no more than one element :exception Modeling.Validation.ValidationException: if more than one task is registered :see: `getTask()`, `setTask()` """ # see http://modeling.sf.net/UserGuide/customobject-validation-by-key.= html # subsection 3.3.2.2. from Modeling import Validation if len(self.getTasks())>1: raise Validation.ValidationException return =20=20 def getTask(self): if self.getTasks(): return self.getTasks()[0] return None =20=20 def setTask(self, task): if self.getTask(): self.removeFromTasks(self.getTask()) self.addToTasks(task) # you can also define the corresponding property: task =3D property(getTask, setTask, None, "to-one relationship to Task") Additional note: with this definition you'll have a foreign key in entity 'Task' pointing to the primary key in entity 'Supplier'. It seems reasonable, but in case you want the inverse, swap tasks and supplier in = the association's definition and define get/setSupplier() in class Task. Regards, -- S=E9bastien. |
From: Wara S. <war...@gm...> - 2005-02-17 08:51:01
|
I've try to create one-to-one association from table Task to Supplier by define model.association = [ Association('Task', 'Supplier',multiplicity=[ [0, 1], [0, 1] ]) ] but the error said ValueError: invalid multiplicity dst->src: should be toMany I've also apply the patch from http://sourceforge.net/mailarchive/message.php?msg_id=9401573 Did I done something wrong? Regrads Wara Songkran |
From: Wolfgang K. <wol...@gm...> - 2004-12-22 18:15:16
|
> And I definitely agree w/ John, in that performance will highly depend on > your particular use-case --maybe you could be more explicit on it? The specific envisaged application case would be as a persistence framework for a toolkit for extracting, transformating and forwarding of data from various sources to various sinks - a re-implementation in 100% pure (C)Python of the Retic toolkit currently which is currently implemented in Jython. But the question was also for general "enterprise" application cases like for an ERP or CMMS system. Best regards, Wolfgang Keller |
From: Wolfgang K. <wol...@gm...> - 2004-12-21 16:43:39
|
Hello, and thanks for your reply. >> In fact my question was raised when I read the article about ERP5 on >> pythonology.org, with the performance values they claimed for ZODB with >> their ZSQLCatalog add-on. I would guess that their performance claims are >> only valid if all the queried objects are in fact in memory...? > > I didn't read that article (didn't search it either I admit, do you have > the hyperlink at hand?), http://www.pythonology.org/success&story=nexedi They claim that "Reading the Zope object database is 10 to 100 times faster than retrieving a row from the fastest relational databases available on the market today". And about ZSQLCatalog in particular: "a Zope database with more than 2,000,000 objects can be queried with statistical methods in a few milliseconds" Best regards, Wolfgang Keller |
From: Sebastien B. <sbi...@us...> - 2004-12-21 14:08:51
|
sbi...@us... wrote: [about optimization advices] > Well, that's always hard to tell without specific use-cases, but the > general advices are: [...] BTW, since I'm at it and that's quite a long time I've not given any news, I also suggest using the latest CVS version (see notes, below). I know it's a real shame I haven't made any release since february, I thought I could at least make one for xmas but obviously I ran out of time, it will be done next january. Also note that section 3. Functionalities for Object Management in the User's Guide has been rewritten and now includes full documentation for: - building modules and classes at runtime (3.1. From model to python code) - the framework's expectations in external code (section 3.2. The framework's requirements on python code) Last, I just want to announce that the patch item #892454: Fetch slices and sort orderings will be integrated into the next release --its current limitations will remain the same, but at least the features it provides will be available out of the box. (https://sf.net/tracker/index.php?func=detail&aid=892454&group_id=58935&atid=489337) Cheers, -- Sébastien. Instructions to get the latest CVS are at https://sourceforge.net/cvs/?group_id=58935 and the latest changes and the description of all bug fixes are at: http://cvs.sf.net/viewcvs.py/modeling/ProjectModeling/CHANGES?view=markup |
From: Sebastien B. <sbi...@us...> - 2004-12-21 14:05:21
|
Hi Wolfgang, John and all, Thanks John for giving the figures for the overhead induced by the framework when creating/manipulating objects. I'm currently away from my computer and I only have a web access, so that's hard to try and compare anything in those conditions ;) Wolfgang Keller <wol...@gm...> wrote: > The question is for me whether Modeling tries to and/or whether there > would be some other way to cut the hourglass-display-time to the > unavoidable minimum (dependend on the database) by some kind of smart > caching of objects or by maintaining some kind of pool of pre-created > object instances. For the moment being the framework does not use any kind of pool of pre-created objects. On the other hand, it caches database snapshots so that the data that have already been fetched is not fetched again (this avoids a time-expensive round-trip to the database). John Lenton <jl...@gm...> wrote: > Modeling [...] only saves those objects that have effectively changed, > so depending on your actual use cases you might be surprised at how > well it works. The loading, modifying and saving of all the objects is > pretty much the worse case; Modeling isn't meant (AFAICT) for that > kind of batch processing. It certainly is convenient, though :) Right: when saving changes the framework uses that cache to save only the objects that were actually modified/deleted. And I definitely agree w/ John, in that performance will highly depend on your particular use-case --maybe you could be more explicit on it? When you say that you need <<to process (create - transform - store) rather important amounts of data >>, do you mean that every single fetched object will be updated and stored back in the database? If this is the case, as John already pointed it out, this is the worst case and the most time-comsuming process you'll have w/ the framework. John Lenton <jl...@gm...> wrote: > Of course, in both cases, writing the sql script would've taken a > *lot* longer than the difference in run time, for me. However, it's > obvious that there are cases where the runtime difference overpowers > the developer time difference... ...and when runtime matters, you can also use the framework on sample data, extract the generated SQL statements and then directly use those statements in the real batch. Wolfgang Keller <wol...@gm...> wrote: > In fact my question was raised when I read the article about ERP5 on > pythonology.org, with the performance values they claimed for ZODB with > their ZSQLCatalog add-on. I would guess that their performance claims are > only valid if all the queried objects are in fact in memory...? I didn't read that article (didn't search it either I admit, do you have the hyperlink at hand?), but I suspect that the performance mostly comes from the fact that the ZODB.Persistent mixin class is written in C: while the overhead for object creation is probably still the same, the process of fully initializing an object (assign values to attributes) is pretty much quicker (as far as I remember, it directly sets the object's __dict__, so yes that's fast ;) The framework spend most of its initializing time in KeyValueCoding, (http://modeling.sourceforge.net/UserGuide/customobject-key-value-coding.html) examining objects and finding the correct way of setting the attributes. While this allows a certain flexibility, I now tend to believe that most applications pay the price for a feature they do not need (for example, the way attributes'values are assigned by the framework should probably be cached per class rather then systematically determined for every object). [1] John Lenton <jl...@gm...> wrote: > Of course, maybe Sébastien has a trick up his sleeve as to how one > could go about using Modeling for batch processing... Well, that's always hard to tell without specific use-cases, but the general advices are: - use the latest python, - use new-style classes rather than old-styles ones, - activate MDL_ENABLE_SIMPLE_METHOD_CACHE (http://modeling.sourceforge.net/UserGuide/env-vars-core.html) - specifically for batch processing: be sure to read: http://modeling.sourceforge.net/UserGuide/ec-discard-changes.html And of course, we'll be happy to examine your particular use-cases to help you optimize the process. -- Sébastien. [1] and thinking a little more about this, I now realize that the way this is done in the framework at initialization time is pretty stupid (the KVC mechanism should definitely be cached somehow at this point: since the framework creates the object before initializing it there is absolutely no reason for different objects of the same class to behave differently wrt KVC at this point)... I'll get back on this for sure. For the curious this is done in DatabaseContext.initializeObject(), lines 1588-1594. For the records I'll add that the prepareForInitializationWithKeys() stuff is also not needed. |
From: Wolfgang K. <wol...@gm...> - 2004-12-20 19:23:03
|
>>> Usually, the penalty does not interfere with the job at hand. >> >> Oops, why? *snip* > Usually you might > *display* all the objects (where rawRows comes in handy), and then the > user selects one of these objects to actually modify (so you fault the > raw object into a real one, work on it, and saveChanges). *click* Of course. > Of course, maybe S=E9bastien has a trick up his sleeve as to how one > could go about using Modeling for batch processing... Not just for batch-processing... In fact my question was raised when I read the article about ERP5 on pythonology.org, with the performance values they claimed for ZODB with their ZSQLCatalog add-on. I would guess that their performance claims are only valid if all the queried objects are in fact in memory...? Best regards Wolfgang Keller |
From: John L. <jl...@gm...> - 2004-12-20 13:44:10
|
On Mon, 20 Dec 2004 14:21:40 +0100, Wolfgang Keller <wol...@gm...> wrote: > Hello, >=20 > and thanks for your reply. >=20 > > Usually, the penalty does not interfere with the job at hand. >=20 > Oops, why? >=20 > Obviously, when all objects get read into memory at startup of the > application server, and written back only at night, then... because this (reading in all the objects, modifying them all, and saving them all) is not the usual use case. Usually you might *display* all the objects (where rawRows comes in handy), and then the user selects one of these objects to actually modify (so you fault the raw object into a real one, work on it, and saveChanges). You still have a 20x penalty, but it's much less then a second in this use case. > > One reference point you might find useful is that when I loading 3000 > > objects from a database, modifying them, and then saving the changes, > > on a 700MHz p3 notebook, the loading took about 40 seconds, and the > > saving, 200. That's 20 times what a direct sql script would've taken. >=20 > This gives me an idea, thanks. A multiplier of 20 is quite significant > imho. >=20 > > Of course, in both cases, writing the sql script would've taken a > > *lot* longer than the difference in run time, for me. However, it's > > obvious that there are cases where the runtime difference overpowers > > the developer time difference... >=20 > I was wondering whether Modeling would be suitable as a persistence layer > for a Python application that needs to process (create - transform - stor= e) > rather important amounts of data. >=20 > The question is for me whether Modeling tries to and/or whether there wou= ld > be some other way to cut the hourglass-display-time to the unavoidable > minimum (dependend on the database) by some kind of smart caching of > objects or by maintaining some kind of pool of pre-created object > instances. Modeling does cache the objects, and only saves those objects that have effectively changed, so depending on your actual use cases you might be surprised at how well it works. The loading, modifying and saving of all the objects is pretty much the worse case; Modeling isn't meant (AFAICT) for that kind of batch processing. It certainly is convenient, though :) Of course, maybe S=E9bastien has a trick up his sleeve as to how one could go about using Modeling for batch processing... --=20 John Lenton (jl...@gm...) -- Random fortune: bash: fortune: command not found |
From: Wolfgang K. <wol...@gm...> - 2004-12-20 13:28:31
|
Hello, and thanks for your reply. > Usually, the penalty does not interfere with the job at hand. Oops, why? Obviously, when all objects get read into memory at startup of the application server, and written back only at night, then... > One reference point you might find useful is that when I loading 3000 > objects from a database, modifying them, and then saving the changes, > on a 700MHz p3 notebook, the loading took about 40 seconds, and the > saving, 200. That's 20 times what a direct sql script would've taken. This gives me an idea, thanks. A multiplier of 20 is quite significant imho. > Of course, in both cases, writing the sql script would've taken a > *lot* longer than the difference in run time, for me. However, it's > obvious that there are cases where the runtime difference overpowers > the developer time difference... I was wondering whether Modeling would be suitable as a persistence layer for a Python application that needs to process (create - transform - store) rather important amounts of data. The question is for me whether Modeling tries to and/or whether there would be some other way to cut the hourglass-display-time to the unavoidable minimum (dependend on the database) by some kind of smart caching of objects or by maintaining some kind of pool of pre-created object instances. Best regards, Wolfgang Keller |
From: John L. <jl...@gm...> - 2004-12-20 13:05:32
|
On Mon, 20 Dec 2004 11:43:07 +0100, Wolfgang Keller <wol...@gm...> wrote: > > given the significant penalty for the creation of Python objects indicated > by most benchmarks I have seen so far, I wonder how and how well Modeling > deals with this issue...? Usually, the penalty does not interfere with the job at hand. However, when you actually need to manipulate a large number of objects, the Modeling overhead can be quite noticeable; when said manipulation is only for querying, using rawRows avoids most of the creation overhead, but when you have to modify the objects in question, you might find yourself waiting quite a long time for saveChanges to complete. One reference point you might find useful is that when I loading 3000 objects from a database, modifying them, and then saving the changes, on a 700MHz p3 notebook, the loading took about 40 seconds, and the saving, 200. That's 20 times what a direct sql script would've taken. On the other hand, loading 100000 objects using rawRows takes about 20 seconds on this same machine. That's 4 times what the straight sql would've taken. Of course, in both cases, writing the sql script would've taken a *lot* longer than the difference in run time, for me. However, it's obvious that there are cases where the runtime difference overpowers the developer time difference... -- John Lenton (jl...@gm...) -- Random fortune: bash: fortune: command not found |
From: Wolfgang K. <wol...@gm...> - 2004-12-20 11:09:57
|
Hello, given the significant penalty for the creation of Python objects indicated by most benchmarks I have seen so far, I wonder how and how well Modeling deals with this issue...? TIA, Best regards Wolfgang Keller |
From: <no...@ti...> - 2004-10-08 13:21:00
|
On 08 Oct 2004 11:02:41 +0200 Sebastien Bigaret <sbi...@us...> wrote: > Are you, by any chance, concurrently accessing the same EC without > locking it? If you do, then maybe you should probably re-read the > dedicated section in the User's Guide :) > http://modeling.sourceforge.net/UserGuide/framework-integration-MT-considerations.html I remember that bit right while writing the previous email :) , I think thats where the problem was. thanks -- Delio |
From: John L. <jl...@gm...> - 2004-10-08 11:36:43
|
On Fri, 8 Oct 2004 08:33:07 -0300, John Lenton <jl...@gm...> wrote: > On 08 Oct 2004 10:58:04 +0200, Sebastien Bigaret > > > <sbi...@us...> wrote: > > > > John Lenton <jl...@gm...> wrote: > > > to test one of the patches I'd need a model to have a relation to an > > > entity that has subclasses; although StoreEmployee has such a relation > > > (Holidays <<-> Employee), it doesn't define the toOne side of that > > > relation, and I notice that is used to test exactly that feature. > > > Should I create a new model that has these properties, or do I add a, > > > say, 'Salary' class? > > > > Yes, go for it and modify the model. Maybe a BankAccount class could > > make more sense? Okay, anyway that's a test model, so the semantics is > > not that important :) > > last night I uploaded a patch that called it 'Salary', but I'll rename > it to 'BankAccount' in a while. I forgot to say this: I uploaded a patch because I already had it ready, and although I have time to create these patches, I don't have a lot of time, so sometimes I get impatient and don't wait as much as I should for the answers, and go with what I think best at the time; I can always revisit the decision later, but this way I can move ahead (still got a ways to go). -- John Lenton (jl...@gm...) -- Random fortune: bash: fortune: command not found |
From: John L. <jl...@gm...> - 2004-10-08 11:33:12
|
On 08 Oct 2004 10:58:04 +0200, Sebastien Bigaret <sbi...@us...> wrote: > > John Lenton <jl...@gm...> wrote: > > to test one of the patches I'd need a model to have a relation to an > > entity that has subclasses; although StoreEmployee has such a relation > > (Holidays <<-> Employee), it doesn't define the toOne side of that > > relation, and I notice that is used to test exactly that feature. > > Should I create a new model that has these properties, or do I add a, > > say, 'Salary' class? > > Yes, go for it and modify the model. Maybe a BankAccount class could > make more sense? Okay, anyway that's a test model, so the semantics is > not that important :) last night I uploaded a patch that called it 'Salary', but I'll rename it to 'BankAccount' in a while. -- John Lenton (jl...@gm...) -- Random fortune: bash: fortune: command not found |
From: Sebastien B. <sbi...@us...> - 2004-10-08 09:03:53
|
no...@ti... wrote: > On 05 Oct 2004 23:42:47 +0200 > Sebastien Bigaret <sbi...@us...> wrote: >=20 > > Okay; if you observe that a freshly fetched object has None as globalId= (), > > this is definitely a bug, so do not hesitate to report! >=20 > I have a deadline on friday and don't have time to write a test, it's nas= ty > ( or simply a problem with my code ) since it appears only if another thr= ead is > fetching the same object from the same EC while I try to retrieve the Glo= balID. > Wouldn't worry until I got some real evidence :-) Are you, by any chance, concurrently accessing the same EC without locking it? If you do, then maybe you should probably re-read the dedicated section in the User's Guide :) http://modeling.sourceforge.net/UserGuide/framework-integration-MT-consider= ations.html Operations on an EC is not thread-safe by default, and concurrent access w/o locking it first could lead to the behaviour you observe (where an object can be observed w/ a gID=3D=3DNone by a given thread while the fetch procedure is still processed in an other thread). -- S=E9bastien. |
From: Sebastien B. <sbi...@us...> - 2004-10-08 08:58:53
|
John Lenton <jl...@gm...> wrote: > to test one of the patches I'd need a model to have a relation to an > entity that has subclasses; although StoreEmployee has such a relation > (Holidays <<-> Employee), it doesn't define the toOne side of that > relation, and I notice that is used to test exactly that feature. > Should I create a new model that has these properties, or do I add a, > say, 'Salary' class? Yes, go for it and modify the model. Maybe a BankAccount class could make more sense? Okay, anyway that's a test model, so the semantics is not that important :) -- S=E9bastien. |
From: John L. <jl...@gm...> - 2004-10-07 16:12:39
|
to test one of the patches I'd need a model to have a relation to an entity that has subclasses; although StoreEmployee has such a relation (Holidays <<-> Employee), it doesn't define the toOne side of that relation, and I notice that is used to test exactly that feature. Should I create a new model that has these properties, or do I add a, say, 'Salary' class? -- John Lenton (jl...@gm...) -- Random fortune: bash: fortune: command not found |
From: John L. <jl...@gm...> - 2004-10-06 11:26:43
|
On 06 Oct 2004 00:03:03 +0200, Sebastien Bigaret <sbi...@us...> wrote: > Before this is fixed, you can have all the tests run w/ the procedure > described in the README: ./run.py (NO -g), plus the three > ./test_EditingContext_XXX.py scripts. > > --> The four test script should give zero error & zero warning w/ > 0.9pre17.1 (this is part of the procedure rnu before every release) ok, except for the encoding errors, this is true here also. > > am I doing something wrong? I'm guessing the README is outdated, > > because I tried that and it was even worse; I ran > > 'test_EditingContext_Global.py -r' and > > 'test_EditingContext_Global_Inheritance.py -r', and then 'run.py -g'. > > These two give errors every time, complaining that > > > > DROP INDEX WRITER_pkey > > error: Couldn't evaluate expression DROP INDEX WRITER_pkey. Reason: > > psycopg.ProgrammingError:ERROR: cannot drop index writer_pkey because > > constraint writer_pkey on table writer requires it > > HINT: You may drop constraint writer_pkey on table writer instead. > > Another bug here. Workaround: to regenerate the test databases, connect > to the admin. db template1, then > > DROP DATABASE "AUTHOR_BOOKS"; > CREATE DATABASE "AUTHOR_BOOKS"; > DROP DATABASE "STORE_EMPLOYEES"; > CREATE DATABASE "STORE_EMPLOYEES" createdb -E LATIN1 AUTHOR_BOOKS; createdb -E LATIN1 STORE_EMPLOYEES works fine too (on debian, at least). > and finally run the scripts: > ./test_EditingContext_Global.py -r > ./test_EditingContext_Global_Inheritance.py -r > > Your test-dbs should then be okay. > > > Also, one thing that isn't mentioned in the README is that the > > database must be created with -E LATIN1, or it will produce an(other) > > error. > > Third bug --could you be more explicit about the error? What is the > default encoding you use, and how can I reproduce it here (an other -E > option?) ? > > If I may ask and I you have some time, could you submit bug reports > @sf.net please? now I know which are bugs in Modeling and not bungles in my setup, I will. -- John Lenton (jl...@gm...) -- Random fortune: bash: fortune: command not found |
From: <no...@ti...> - 2004-10-06 05:49:16
|
On 05 Oct 2004 23:42:47 +0200 Sebastien Bigaret <sbi...@us...> wrote: > Okay; if you observe that a freshly fetched object has None as globalId(), > this is definitely a bug, so do not hesitate to report! I have a deadline on friday and don't have time to write a test, it's nasty ( or simply a problem with my code ) since it appears only if another thread is fetching the same object from the same EC while I try to retrieve the GlobalID. Wouldn't worry until I got some real evidence :-) ciao -- Delio |