modeling-users Mailing List for Object-Relational Bridge for python (Page 8)
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: Duncan M. <py...@ad...> - 2004-08-09 03:35:55
|
On Aug 7, 2004, at 11:34 AM, Sebastien Bigaret wrote: >> Does/can the EC keep an open connection to the database? > > Fine. The framework keeps it opened by default --see documentation for > MDL_TRANSIENT_DB_CONNECTION at > http://modeling.sourceforge.net/UserGuide/env-vars-core.html > (the pdf is still wrong, I updated that section yesterday) Awesome. >>> In other words, does it mean that "for each session's EC there >>> exists >>> one and only one connection to the db"?? >> >> Yes. That makes sense, though, right? I mean, if there is a web app >> with >> which a user could potentially make hundreds of queries to the >> database, >> we'd want to keep their connection open instead of pounding the db >> with new >> connections, right? > > Yes --but the need to keep a database connection opened, or the need to > have an opened database connection per user/session is quite different. Since the basic requirements were to have minimal connects to the database server, the default behaviour of keeping the connection open is just fine. However, what happens when I use EditingContextSessioning? It seems to create an EC keyed off a session id. Will that keep one complete editing context per user session (and thus one opened database connection per session)? or am I missing something? >>> If this is the case, then we'll need an other ObjectStoreCoordinator, >>> assigning a dedicated DBContext to each EC... Hmmm, just thinking >>> loudly >>> here, okay, I'll wait til you confirm the need for such a feature. >> >> How much work is entailed in this? What would the other OSC do? > > It would assign specific elements of the Database (DBContext, > DBChannel) > and Adaptor (AdaptorContext, AdaprotChannel) layers per EC. At least, > that's what I initially thought. There may be another way to ensure > different fetchs could run concurrently --but if you can accept that > any > fecth waits for the running one to finish, it's probably not worth the > effort, or am I still missing something? There is no business need or user demand for this app that will require super-speeds and concurrent queries per session, so I think it's fine without going through this trouble... yet ;-) Thanks for your help! I'm sure this will be a good one for the archives, too... lots of session-driven apps out there that can benefit from Modeling... d |
From: Sebastien B. <sbi...@us...> - 2004-08-07 15:34:05
|
Duncan McGreggor <py...@ad...> wrote: [snip] > Yes, that was the direction I was heading with my questions. However, this > may not truly be the business need. More details: >=20 > * There are probably never (famous last words) going to be more than 20 > simultaneous > * When a user logs in, a connection to the database will be opened for th= em > (via an editing context) > * This connection need to be kept open for this user until their session > expires in order to minimize the overhead of stale open database connecti= ons > on the database server >=20 > Does/can the EC keep an open connection to the database? Fine. The framework keeps it opened by default --see documentation for MDL_TRANSIENT_DB_CONNECTION at http://modeling.sourceforge.net/UserGuide/env-vars-core.html (the pdf is still wrong, I updated that section yesterday) > > You also wrote: > >> What they meant by pooling is not what Oracle developers usually mean; > >> they want to be sure that for every HTTP Session, and all of it's HTTP > >> requests, there is a single connection to the database that is reused > >> for the entire length of the session lifetime. > > > > In other words, does it mean that "for each session's EC there exists > > one and only one connection to the db"?? >=20 > Yes. That makes sense, though, right? I mean, if there is a web app with > which a user could potentially make hundreds of queries to the database, > we'd want to keep their connection open instead of pounding the db with n= ew > connections, right? Yes --but the need to keep a database connection opened, or the need to have an opened database connection per user/session is quite different. > > If this is the case, then we'll need an other ObjectStoreCoordinator, > > assigning a dedicated DBContext to each EC... Hmmm, just thinking loudly > > here, okay, I'll wait til you confirm the need for such a feature. >=20 > How much work is entailed in this? What would the other OSC do? It would assign specific elements of the Database (DBContext, DBChannel) and Adaptor (AdaptorContext, AdaprotChannel) layers per EC. At least, that's what I initially thought. There may be another way to ensure different fetchs could run concurrently --but if you can accept that any fecth waits for the running one to finish, it's probably not worth the effort, or am I still missing something? -- S=E9bastien. |
From: Sebastien B. <sbi...@us...> - 2004-08-07 13:30:47
|
Hi Erny and all, On Wed, 30 Jun 2004, Ernesto Revilla <er...@si...> wrote: [original post can be found at: https://sf.net/mailarchive/forum.php?thread_id=3D5035017&forum_id=3D10674] > I think that Python has a design error with properties, but it is easy to > correct this.=20 [demonstration that properties aint behaving very good when it comes to inheritance] > In Modeling, when inheriting from class created with properties (dynamic)= , it > does NOT the inherited methods. Is this reasonable? You're right, this needs some attention, really. Could you submit this as a bug report or as a patch proposal @sf.net please? > Here I have attached a > little patch for dynamic.py. I made a local function mkProp, so that vari= able > binding is correct, otherwise it does not work the way it should. Can you be more explicit on this point? > Just a > remark about the setter. As in the original code, a virtual setter is cre= ated > only if the attribute is settable in the base class. In this case, we hav= e two > alternatives: 1. do not create a setter, as the original code, 2. create > always a virtual setter and the setter in the base class raises a > ReadOnlyAttributeException. (This is was I have done in a experimental > framework.) For the moment being we're not handling any 'readOnly' properties on attributes --and the one in entity is still ignored for now, so I can't really see whazt your point is, I suspect I'm misunderstanding something here. Oh, and BTW sorry for taking such a long time to answer :/ -- S=E9bastien. > Index: dynamic.py > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvsroot/modeling/ProjectModeling/Modeling/dynamic.py,v > retrieving revision 1.1 > diff -u -r1.1 dynamic.py > --- dynamic.py 16 Feb 2004 20:01:06 -0000 1.1 > +++ dynamic.py 30 Jun 2004 16:07:47 -0000 > @@ -144,10 +144,16 @@ > def add_properties(aClass, entity): > for p in entity.classProperties(): > #print 'defining prop: ', p.name() > - part_func_name=3DcapitalizeFirstLetter(p.name()) > - prop=3Dproperty(getattr(aClass, 'get'+part_func_name), > - getattr(aClass, 'set'+part_func_name), None) > - setattr(aClass, p.name(), prop) > + part_func_name=3DcapitalizeFirstLetter(p.name()) > + readonly=3Dnot hasattr(aClass,'set'+part_func_name) > + def mkProp(name, readonly=3D0): > + getter=3Dlambda s: getattr(s,'get'+name)() > + if readonly: > + setter=3DNone > + else: > + setter=3Dlambda s, v: getattr(s,'set'+name)(v) > + return property(getter, setter) > + setattr(aClass, p.name(), mkProp(part_func_name, readonly)) >=20=20=20=20=20=20 > def build(model, define_properties=3D0): > module_name=3Dmodel.packageName() |
From: Duncan M. <du...@ad...> - 2004-08-06 23:04:31
|
On Aug 6, 2004, at 6:50 PM, Duncan McGreggor wrote: > * There are probably never (famous last words) going to be more than > 20 simultaneous I meant 20 sim. users ;-) |
From: Duncan M. <py...@ad...> - 2004-08-06 23:02:19
|
On Aug 6, 2004, at 3:33 PM, Sebastien Bigaret wrote: > Now, this can be fine... or not, depending on the type of application > you're currently building (I mean, its characteristics, esp. if you can > expect heavy load). We're expecting very light load. > For example, say that some of fetches can take some time --can you wait > for a fetch to be finished before serving others? We are expecting that there will be some delays perceived by users during regular use as you describe here. This is okay :-) > If your app. does not > fetch a lot, maybe it's not a pb, but if most of its requests end up > with one or more ec.fetch() then the default behaviour will probably > not > be suitable. > > And again, could you be more explicit whether in your first mail you > meant that "for each session's EC there exists one and only one > connection to the db"?? Sorry about responding so late; did my last email make this more clear, or should I send along more details/better explanation? |
From: Duncan M. <py...@ad...> - 2004-08-06 22:50:52
|
On Aug 4, 2004, at 6:54 PM, Sebastien Bigaret wrote: > > And BTW, I suspect that if you've already given a try to the > ECSessioning module, or thought aboyut using it, then all the sessions > probably lie in the same process --or it would have been useless. > > So, now, I see the moment coming where you'll ask whether it's > possible to have a dedicated db-connection per EC; is that it? Yes, that was the direction I was heading with my questions. However, this may not truly be the business need. More details: * There are probably never (famous last words) going to be more than 20 simultaneous * When a user logs in, a connection to the database will be opened for them (via an editing context) * This connection need to be kept open for this user until their session expires in order to minimize the overhead of stale open database connections on the database server Does/can the EC keep an open connection to the database? > You also wrote: >> What they meant by pooling is not what Oracle developers usually mean; >> they want to be sure that for every HTTP Session, and all of it's HTTP >> requests, there is a single connection to the database that is reused >> for the entire length of the session lifetime. > > In other words, does it mean that "for each session's EC there exists > one and only one connection to the db"?? Yes. That makes sense, though, right? I mean, if there is a web app with which a user could potentially make hundreds of queries to the database, we'd want to keep their connection open instead of pounding the db with new connections, right? > If this is the case, then we'll need an other ObjectStoreCoordinator, > assigning a dedicated DBContext to each EC... Hmmm, just thinking > loudly > here, okay, I'll wait til you confirm the need for such a feature. How much work is entailed in this? What would the other OSC do? |
From: Sebastien B. <sbi...@us...> - 2004-08-06 19:44:57
|
so...@la... wrote: > Take caution to one thing: > Modeling heavly cache objects. So to be sure to have it working you have = 2=20 > options: > - use a single python interpeter (using the ad-hoc apache2 config) > - or disable Editing Context caches ..=20 > > In this too approach the main drawnback is performance. I think the best > way to solve this is to use something that give you a finer gain. I think > quixote for example can fix that. I mean: You have a 1 process that fork > and re-use process. By this way you can have Modeling caches (perhaps > need extra lock to avoid crash) and don't bother w/ the forking needed=20 > at every request. (import Modeling is time consumming ..)=20 I'm not sure this is exact --I've read your post there, and I do not agree w/ your analysis: I can be wrong of course since my experience w/ mod_python is really thin, but to my understanding there is a global namespace available w/ mod-python, the global namespace that exists within the subinterpreter dedicated to an application. And since the sub-interpreter is created once and never destroyed (unless apache is restarted :) time needed for imports should not be a problem. [Note: I have only experimented w/ mod_python 3.1.3 for Apache 2.0, maybe it's different from v2.7.10 for Apache 1.x?] > Look at http://www.larsen-b.com/Article/130.html for little deeper explai= n of > the problem.=20 >=20 > I haven't do this kind of stuff for a while.. but i think Modeling need=20 > something like Durus do .. a server process.. :)=20 Interesting indeed, I'll have a look at that. Do you have experience with this? How do they serialize objects that are transmitted between the server and its client? -- S=E9bastien. |
From: Sebastien B. <sbi...@us...> - 2004-08-06 19:33:47
|
Duncan McGreggor <py...@ad...> wrote: [snipped] > We've been running a default mod_python apache configuration: 1 main proc= ess, > and multiple child processes are spawned as needed. I don't and have never > programmed in threads and don't really understand it, so you'll have to > forgive my terminology, if incorrect... >=20 > I guess we could setup mod_python to run a single interpreter > (http://www.modpython.org/live/current/doc-html/dir-other-pi.html), I wou= ld > want to do that only if we had to though... I think we would loose many o= f the > performance gains our client sought by going with mod_python in the first > place... >=20 I do not think so, because requests can be handled concurrently within a single interpreter. And that's what I believe it is done --quoted from http://www.modpython.org/live/current/doc-html/pyapi-interps.html: Default behaviour is to name interpreters using the Apache virtual server name (ServerName directive). This means that all scripts in the same virtual server execute in the same subinterpreter, but scripts in different virtual servers execute in different subinterpreters with completely separate namespaces I've not played a lot with mod_python (just a few hours, in fact), but AFAIK this means that a given application will always be served by the same interpreter. And in such a configuration: - the ECSessioning works, - so each session will get its own EC, - you'll basically get one connection to the database for all. Now, this can be fine... or not, depending on the type of application you're currently building (I mean, its characteristics, esp. if you can expect heavy load). For example, say that some of fetches can take some time --can you wait for a fetch to be finished before serving others? If your app. does not fetch a lot, maybe it's not a pb, but if most of its requests end up with one or more ec.fetch() then the default behaviour will probably not be suitable. And again, could you be more explicit whether in your first mail you meant that "for each session's EC there exists one and only one connection to the db"?? -- S=E9bastien. |
From: <so...@la...> - 2004-08-06 17:23:06
|
Take caution to one thing: Modeling heavly cache objects. So to be sure to have it working you have 2 options: - use a single python interpeter (using the ad-hoc apache2 config) - or disable Editing Context caches .. In this too approach the main drawnback is performance. I think the best way to solve this is to use something that give you a finer gain. I think quixote for example can fix that. I mean: You have a 1 process that fork and re-use process. By this way you can have Modeling caches (perhaps need extra lock to avoid crash) and don't bother w/ the forking needed at every request. (import Modeling is time consumming ..) Look at http://www.larsen-b.com/Article/130.html for little deeper explain of the problem. I haven't do this kind of stuff for a while.. but i think Modeling need something like Durus do .. a server process.. :) Bye Bye |
From: Dennis K. <djk...@ya...> - 2004-08-05 13:45:10
|
I am but it may take me a week or so to get up to speed on the framework, as I have not used it yet. I have postgres installed on cygwin which I can use to get familiar with Modeling. I'm sure this will help when going through the source code as well. --- "Driver, David" <DD...@co...> wrote: > So Dennis, Are you interested in working on this? > > -----Original Message----- > From: Sebastien Bigaret > [mailto:sbi...@us...] > Sent: Tuesday, August 03, 2004 3:15 PM > To: Dennis Kertis; David Driver > Cc: mod...@li... > Subject: Re: [Modeling-users] Porting to SQL Server > > > Dennis Kertis <djk...@ya...> wrote: > > I am interested in using the Modeling framework > for > > SQL Server and was wondering what is involved with > > designing support for SQL Server? Any way someone > > could give me a rough estimate of the time it > would > > take? I'd like to know what I am getting myself > into. > > The time needed for the development of a new adaptor > layer can be > roughly counted in days; it essentially depends on > how far the database > server stands from SQL standards, obviously on how > good you know the > server and its python adaptors, and how familiar one > is with the MDL > framework. > > I cannot help w/ SQL Server, and I won't be able > to have a SQL Server > here (unless iot cabn be deployed on Linux ;) > --but I can help during > the development of a new adaptor, esp. regarding > integration into the > framework and the test-units. > > You can have a look at the existing adaptor layers > to get an idea of > what needs to be done, and ask for more here. > > Some questions that needs to be answered before > starting: > > - how to make SQL JOINs > - does SQL Server support sequences? (for PK > generation) > > - check whether the types declared in > SQLExpression's > valueTypeForExternalTypeMapping() are > supported, and whether some > should be added > > In any ways I'll be happy to collaborate w/ you and > David to make this > happen. > > -- Sébastien. > > P.-S.: Oh, BTW, if we go for adding this into the > framework it would be > important that it can be tested on a regular > basis, esp. before a > release is made; would someone maybe consider to > offer an access to a > sample db-server, or take the responsability for > these tests? > > __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail |
From: Driver, D. <DD...@co...> - 2004-08-05 13:12:25
|
So Dennis, Are you interested in working on this?=20 -----Original Message----- From: Sebastien Bigaret [mailto:sbi...@us...]=20 Sent: Tuesday, August 03, 2004 3:15 PM To: Dennis Kertis; David Driver Cc: mod...@li... Subject: Re: [Modeling-users] Porting to SQL Server Dennis Kertis <djk...@ya...> wrote: > I am interested in using the Modeling framework for > SQL Server and was wondering what is involved with > designing support for SQL Server? Any way someone > could give me a rough estimate of the time it would > take? I'd like to know what I am getting myself into. The time needed for the development of a new adaptor layer can be roughly counted in days; it essentially depends on how far the database server stands from SQL standards, obviously on how good you know the server and its python adaptors, and how familiar one is with the MDL framework. I cannot help w/ SQL Server, and I won't be able to have a SQL Server here (unless iot cabn be deployed on Linux ;) --but I can help during the development of a new adaptor, esp. regarding integration into the framework and the test-units. You can have a look at the existing adaptor layers to get an idea of what needs to be done, and ask for more here. Some questions that needs to be answered before starting: - how to make SQL JOINs - does SQL Server support sequences? (for PK generation) - check whether the types declared in SQLExpression's valueTypeForExternalTypeMapping() are supported, and whether some should be added In any ways I'll be happy to collaborate w/ you and David to make this happen. -- S=E9bastien. P.-S.: Oh, BTW, if we go for adding this into the framework it would be important that it can be tested on a regular basis, esp. before a release is made; would someone maybe consider to offer an access to a sample db-server, or take the responsability for these tests? |
From: Duncan M. <py...@ad...> - 2004-08-05 01:48:37
|
On Aug 4, 2004, at 3:46 PM, Sebastien Bigaret wrote: > > Hi Duncan, > > Before answering and since I've never used the mod_python and any of > its session management tools, could you please tell: > > - which session management module you intend to use? > (http://www.modpython.org/FAQ/faqw.py?req=all#3.8) You bet, and sorry about leaving out that detail. We are using mod_python 3.1, and using the built-in session management. Here are the links: http://www.modpython.org/live/current/doc-html/pyapi-sess.html http://www.modpython.org/live/current/doc-html/pyapi-sess-classes.html > - how does it work? I mean, from a process or thread perspective, can > you be more explicit? Sure; here's a description of how the python interpreter and something called "subinterpreters" work in mod_python: http://www.modpython.org/live/current/doc-html/pyapi-interps.html I'm no expert on the internals of mod_python, but here's a quick run-down of a typical series of steps apache + a simple mod_python setup go through during the lifetime of a request: http://www.modpython.org/live/current/doc-html/tut-what-it-do.html We've been running a default mod_python apache configuration: 1 main process, and multiple child processes are spawned as needed. I don't and have never programmed in threads and don't really understand it, so you'll have to forgive my terminology, if incorrect... I guess we could setup mod_python to run a single interpreter (http://www.modpython.org/live/current/doc-html/dir-other-pi.html), I would want to do that only if we had to though... I think we would loose many of the performance gains our client sought by going with mod_python in the first place... > In short, the answer depends on the answer of those questions; the > EditorContextSessioning component only provides an easy way to register > and retrieve the EC based on a session id. Ah... this is good information. > The number of connection to > the database is independent to this component, and is usually 1 (one) > per process (I really mean process here, not threads, a DB connection > is > shared by threads within a single process). That's why I asked about > the > way mod_python + the session management module you'll use handle > sessions wrt processes. You're out of my depth here, but I can dig some more if the above info doesn't answer these questions... Thanks! Duncan |
From: Sebastien B. <sbi...@us...> - 2004-08-04 22:54:47
|
And BTW, I suspect that if you've already given a try to the ECSessioning module, or thought aboyut using it, then all the sessions probably lie in the same process --or it would have been useless. So, now, I see the moment coming where you'll ask whether it's possible to have a dedicated db-connection per EC; is that it? You also wrote: > What they meant by pooling is not what Oracle developers usually mean;=20 > they want to be sure that for every HTTP Session, and all of it's HTTP=20 > requests, there is a single connection to the database that is reused=20 > for the entire length of the session lifetime. In other words, does it mean that "for each session's EC there exists one and only one connection to the db"?? If this is the case, then we'll need an other ObjectStoreCoordinator, assigning a dedicated DBContext to each EC... Hmmm, just thinking loudly here, okay, I'll wait til you confirm the need for such a feature. -- S=E9bastien. Sebastien Bigaret <sbi...@us...> wrote: > Hi Duncan, >=20 > Before answering and since I've never used the mod_python and any of > its session management tools, could you please tell: >=20 > - which session management module you intend to use? > (http://www.modpython.org/FAQ/faqw.py?req=3Dall#3.8) >=20 > - how does it work? I mean, from a process or thread perspective, can > you be more explicit? >=20 > In short, the answer depends on the answer of those questions; the > EditorContextSessioning component only provides an easy way to register > and retrieve the EC based on a session id. The number of connection to > the database is independent to this component, and is usually 1 (one) > per process (I really mean process here, not threads, a DB connection is > shared by threads within a single process). That's why I asked about the > way mod_python + the session management module you'll use handle > sessions wrt processes. >=20 > -- S=E9bastien. >=20 >=20 > Duncan McGreggor <py...@ad...> wrote: > > Hey Folks, > >=20 > > We're building an application that uses Modeling, and a couple question= s came > > up in a meeting today. The biggest concern was about sessions (what they > > called database pooling or connection pooling). I did have a look at > > EditorContextSessioning, and let them know about it, and it looks like = it will > > suite our needs. However, I wanted to get some explicit feedback, just = to be > > sure ;-) > >=20 > > Application Activity: there's going to be lots of querying, searching, = and > > updating (the last to a lesser degree). > > Application Framework: Apache + mod_python with the mod_python Session = object > > for session management > >=20 > > What they meant by pooling is not what Oracle developers usually mean; = they > > want to be sure that for every HTTP Session, and all of it's HTTP reque= sts, > > there is a single connection to the database that is reused for the ent= ire > > length of the session lifetime. > >=20 > > Is that, in a nutshell, what we get when we use EditorContextSessioning? > >=20 > > Thanks! > >=20 > > Duncan |
From: Sebastien B. <sbi...@us...> - 2004-08-04 19:47:15
|
Hi Duncan, Before answering and since I've never used the mod_python and any of its session management tools, could you please tell: - which session management module you intend to use? (http://www.modpython.org/FAQ/faqw.py?req=3Dall#3.8) - how does it work? I mean, from a process or thread perspective, can you be more explicit? In short, the answer depends on the answer of those questions; the EditorContextSessioning component only provides an easy way to register and retrieve the EC based on a session id. The number of connection to the database is independent to this component, and is usually 1 (one) per process (I really mean process here, not threads, a DB connection is shared by threads within a single process). That's why I asked about the way mod_python + the session management module you'll use handle sessions wrt processes. -- S=E9bastien. Duncan McGreggor <py...@ad...> wrote: > Hey Folks, >=20 > We're building an application that uses Modeling, and a couple questions = came > up in a meeting today. The biggest concern was about sessions (what they > called database pooling or connection pooling). I did have a look at > EditorContextSessioning, and let them know about it, and it looks like it= will > suite our needs. However, I wanted to get some explicit feedback, just to= be > sure ;-) >=20 > Application Activity: there's going to be lots of querying, searching, and > updating (the last to a lesser degree). > Application Framework: Apache + mod_python with the mod_python Session ob= ject > for session management >=20 > What they meant by pooling is not what Oracle developers usually mean; th= ey > want to be sure that for every HTTP Session, and all of it's HTTP request= s, > there is a single connection to the database that is reused for the entire > length of the session lifetime. >=20 > Is that, in a nutshell, what we get when we use EditorContextSessioning? >=20 > Thanks! >=20 > Duncan |
From: Duncan M. <py...@ad...> - 2004-08-04 19:13:56
|
Hey Folks, We're building an application that uses Modeling, and a couple questions came up in a meeting today. The biggest concern was about sessions (what they called database pooling or connection pooling). I did have a look at EditorContextSessioning, and let them know about it, and it looks like it will suite our needs. However, I wanted to get some explicit feedback, just to be sure ;-) Application Activity: there's going to be lots of querying, searching, and updating (the last to a lesser degree). Application Framework: Apache + mod_python with the mod_python Session object for session management What they meant by pooling is not what Oracle developers usually mean; they want to be sure that for every HTTP Session, and all of it's HTTP requests, there is a single connection to the database that is reused for the entire length of the session lifetime. Is that, in a nutshell, what we get when we use EditorContextSessioning? Thanks! Duncan |
From: Sebastien B. <sbi...@us...> - 2004-08-03 20:15:24
|
Dennis Kertis <djk...@ya...> wrote: > I am interested in using the Modeling framework for > SQL Server and was wondering what is involved with > designing support for SQL Server? Any way someone > could give me a rough estimate of the time it would > take? I'd like to know what I am getting myself into. The time needed for the development of a new adaptor layer can be roughly counted in days; it essentially depends on how far the database server stands from SQL standards, obviously on how good you know the server and its python adaptors, and how familiar one is with the MDL framework. I cannot help w/ SQL Server, and I won't be able to have a SQL Server here (unless iot cabn be deployed on Linux ;) --but I can help during the development of a new adaptor, esp. regarding integration into the framework and the test-units. You can have a look at the existing adaptor layers to get an idea of what needs to be done, and ask for more here. Some questions that needs to be answered before starting: - how to make SQL JOINs - does SQL Server support sequences? (for PK generation) - check whether the types declared in SQLExpression's valueTypeForExternalTypeMapping() are supported, and whether some should be added In any ways I'll be happy to collaborate w/ you and David to make this happen. -- S=E9bastien. P.-S.: Oh, BTW, if we go for adding this into the framework it would be important that it can be tested on a regular basis, esp. before a release is made; would someone maybe consider to offer an access to a sample db-server, or take the responsability for these tests? |
From: Driver, D. <DD...@co...> - 2004-08-03 12:49:17
|
I am interested in a sql server porting as well I just didn't want to start it on my own. I have never worked on oss, just with. I am willing to code and or test. |
From: Dennis K. <djk...@ya...> - 2004-08-02 14:02:22
|
I am interested in using the Modeling framework for SQL Server and was wondering what is involved with designing support for SQL Server? Any way someone could give me a rough estimate of the time it would take? I'd like to know what I am getting myself into. thanks, Dennis __________________________________ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail |
From: Sebastien B. <sbi...@us...> - 2004-08-01 12:13:30
|
Hi Javier, The good news is: there is no problem to model your schema! Simply declare the two entities, Person and SisDocumentTypes, with fields 'id' being primary keys and 'fk_idSisDocumentType' being a FK, and the appropriate relationship between Person and SisDocumentTypes. The PKs are created, indeed, using a sequence to ensure that they are unique even in a multi-threaded environment. But the PKs themselves are *not* sequences, just plain columns, as expected: ID INTEGER NOT NULL; Now, about the fact that you're initializing the SisDocumentTypes, you have two options: 1. use the framework to create the SisDocumentTypes, and then link the objects on with another (see below) 2. dump an existing SQL table into the SisDocumentTypes table. If you do this, then you'll have to modify the 'pk_seq_sis_document_types' sequence (or table, depending on the adaptor you're using) so that it contains the max(SIS_DOCUMENT_TYPES.id)+1. Solution 1. could be something like this: a. create pymodel_Example.py:: from Modeling.PyModel import * =20=20=20=20 Entity.defaults['properties'] =3D [ APrimaryKey('id', doc=3D'PK') ] =20=20=20=20 _connDict =3D {'database': 'example', 'host':'localhost', 'user':'postgres','password':''} model =3D Model('Example',adaptorName=3D'Postgresql', connDict=3D_connD= ict) model.version=3D'0.1' model.entities =3D [ Entity('Person', properties=3D[ AString('name', isRequired=3D1), AString('documentNumber', width=3D30), AForeignKey('fk_idSisDocumentType'), ], ), Entity('SisDocumentTypes', properties=3D[ AString('description',isRequired=3D1, width=3D3= 0) ], ), ] #--- model.associations=3D[ Association('Person', 'SisDocumentTypes', relations=3D['docType', 'persons'], delete=3D['nullify', 'deny'], keys=3D['fk_idSisDocumentType', 'id']), ] model.build() b. Use it! Create the doctypes first: >>> # Load the model and build the classes ... from Modeling.EditingContext import EditingContext >>> from Modeling import Model, ModelSet, dynamic >>> model=3DModel.searchModel('Example',verbose=3D1) >>> ModelSet.defaultModelSet().addModel(model) >>> dynamic.build_with_metaclass(model) >>> from Example import Person, SisDocumentTypes =20=20=20=20 >>> # create the SisDocumentTypes ... ec=3DEditingContext() >>> s1 =3D SisDocumentTypes.SisDocumentTypes() >>> s2 =3D SisDocumentTypes.SisDocumentTypes() >>> s3 =3D SisDocumentTypes.SisDocumentTypes() >>> ec.insert(s1); ec.insert(s2); ec.insert(s3) >>> s1.setDescription('DNI') >>> s2.setDescription('CUIT') >>> s3.setDescription('LE') >>> ec.saveChanges() At this point the database contains:: example=3D# select id,description from SIS_DOCUMENT_TYPES; id | description=20 ----+------------- 1 | DNI 2 | CUIT 3 | LE (3 rows) The ids have been automatically created. There is no guarantee that DNI gets the value 1 for its id, however, buity that's probably not a problem, or is it? (if it is, then you want the solution 2. explained above) c. Now its possible to create a person and link it to an existing doc.type:: >>> ec=3DEditingContext() >>> p=3DPerson.Person() >>> ec.insert(p) >>> p.setName('Javier') >>> p.setDocumentNumber('25.948.547') >>> # get the appropriate doc.type ... DNI=3Dec.fetch('SisDocumentTypes', qualifier=3D'description=3D=3D"D= NI"')[0] >>> # link them ... DNI.addToPersons(p) >>> p.setDocType(DNI) >>> ec.saveChanges() Now the db contains:: example=3D# select id,name,fk_id_sis_document_type,document_number example-# from PERSON; id | name | fk_id_sis_document_type | document_number=20 ----+--------+-------------------------+----------------- 1 | Javier | 1 | 25.948.547 (1 row) Hopefully this makes sense and answers your question!) -- S=E9bastien. Javier Castro <jav...@ne...> wrote: > Hi: >=20 > I has a ask for you about Modeling. >=20 > The thing is, i'm accostumed to work with 'system tables' in some ER > models i work... >=20 > These system tables serve for this...=20 >=20 > Let's say we have a Person, and a Person can have different document > 'types'... then , i model this like that.. >=20 > PERSON(id, name, fk_idSisDocumentType, documentNumber, ....) >=20 > SisDocumentTypes(id, description) >=20 > Where that 'system table' will have data like those: >=20 > (1, 'DNI') > (2, 'CUIT') > (3, 'LE') > ... >=20 > and in person we can have: >=20 > (1, 'Javier', 1, '25.948.547') > (2, 'Alejandro', 2, '45.456') > (3, 'Jaime', 3, 'AC-1234') >=20 >=20 >=20 > Well, i want to know if there is some way to model this on Modeling, > cause i saw that each no-abstract entity on Modeling 'must have' > APrimaryKey... >=20 > On my example, id on SisDocumentTypes IS A PRIMARY KEY for that > relation... and IS A FOREIGN KEY for PERSON relation... but in modeling, > each PrimaryKey on and Entity in a PyModel, is always a SEQUENCE on the > underlying database? How can i then model that on Modeling? I dont want > that modeling creates an 'automumeric' key on SisDocumentTypes... cause > these values are not inserted by the final user of the system, but yes > by me! That relation is 'initialized' with the allowed values on > deployment of the database, and then it can't be modified by the final > users. Final user just can select those values from a "combobox" on > Person's insert/update form. I hope i'm making me understood, cause > english is not my native language. :) >=20 > I though that i could create SisDocumentTypes like that: >=20 > model.entities =3D [ Entity ('SisDocumentTypes', > properties =3D [ AInteger('id'), > AString('description') ] > ] >=20 >=20 >=20 > But, then.... id is not primary key, and i can't do a simple Association > with that relation :( >=20 > Please, help me!! >=20 > Javier A. Castro > Nexion Software > Italia 1508, 1=BA Piso, Of. 2 > CP 8332 - General Roca - R=EDo Negro >=20 > www.nexion.com.ar |
From: Javier C. <jav...@ne...> - 2004-07-29 23:22:49
|
Hi: I has a ask for you about Modeling. The thing is, i'm accostumed to work with 'system tables' in some ER models i work... These system tables serve for this... Let's say we have a Person, and a Person can have different document 'types'... then , i model this like that.. PERSON(id, name, fk_idSisDocumentType, documentNumber, ....) SisDocumentTypes(id, description) Where that 'system table' will have data like those: (1, 'DNI') (2, 'CUIT') (3, 'LE') ... and in person we can have: (1, 'Javier', 1, '25.948.547') (2, 'Alejandro', 2, '45.456') (3, 'Jaime', 3, 'AC-1234') Well, i want to know if there is some way to model this on Modeling, cause i saw that each no-abstract entity on Modeling 'must have' APrimaryKey... On my example, id on SisDocumentTypes IS A PRIMARY KEY for that relation... and IS A FOREIGN KEY for PERSON relation... but in modeling, each PrimaryKey on and Entity in a PyModel, is always a SEQUENCE on the underlying database? How can i then model that on Modeling? I dont want that modeling creates an 'automumeric' key on SisDocumentTypes... cause these values are not inserted by the final user of the system, but yes by me! That relation is 'initialized' with the allowed values on deployment of the database, and then it can't be modified by the final users. Final user just can select those values from a "combobox" on Person's insert/update form. I hope i'm making me understood, cause english is not my native language. :) I though that i could create SisDocumentTypes like that: model.entities = [ Entity ('SisDocumentTypes', properties = [ AInteger('id'), AString('description') ] ] But, then.... id is not primary key, and i can't do a simple Association with that relation :( Please, help me!! Javier A. Castro Nexion Software Italia 1508, 1º Piso, Of. 2 CP 8332 - General Roca - Río Negro www.nexion.com.ar |
From: John L. <jl...@gm...> - 2004-07-29 18:10:20
|
On 29 Jul 2004 10:30:02 +0200, Sebastien Bigaret <sbi...@us...> wrote: > > Hi John, > > Again, could you be a little more explicit, or exhibit a short > example? Sorry for getting back on this, but the only way I think this > can happen is the one I already posted (see below); if it's not the > case, this is a serious bug I definitely do not want to let escape. sorry for not getting back to you. I have yet to sit down and reproduce that with the "stock" modeling; I'll try to do it today. The only difference between what I posted and what I actually ran was the names of the entities; as I say, I'll try to get a full example to you today. -- John Lenton (jl...@gm...) -- Random fortune: bash: fortune: command not found |
From: Duncan M. <py...@ad...> - 2004-07-29 15:55:39
|
On Jul 29, 2004, at 4:47 AM, Sebastien Bigaret wrote: > This is great news and yes, a Sybase adaptor will certainly be useful. > > However, sorry, I've never used any sybase db server aither, so I've > no experience to offer. But we can definitely work together to make > it happen, esp. regarding testing and integrating it into the > framework. Yeah, neither have I; I'm getting some experienced Sybase folks to work with me on this project and advise on Sybase SQL dialect. > Integrating a new layer in the framework means that we should be able > to > integrate it into the testing units, so we should also be able to > deploy > a dedicated db-server on the testing machines. With respect to these > requirements, could you confirm that the testing components are the > following? > > - Sybase Adaptive Server Enterprise 12.5.2 > (http://www.sybase.com/detail?id=1030941) > > - Sybase module for Python (python DB API v2.0 compliant) > (http://www.object-craft.com.au/projects/sybase/) Yes, those are the kind and versions we are using. > I can only test linux-based configurations; if you plan to use > different > components and/or different OSes, could you let us know? You bet. I will be testing on a SuSE 9.0 box myself. I don't know what flavor of linux the group at AOL uses, but I will find out today at the kickoff meeting. We also have another potential client, and for them we will be putting a Mac OS X Xserver appliance in place for them. > Looking forward to download the first draft of a Sybase adaptor ;), Awesome! I've got a skeleton in place, based on the Postgresql adaptor; I'm waiting on the Sybase experts right now. This project has a very short timeline, so I expect I should have something to you very shortly. Thanks! Duncan |
From: Sebastien B. <sbi...@us...> - 2004-07-29 08:47:57
|
Hi Duncan, Duncan McGreggor <py...@ad...> wrote: > Hey folks, >=20 > I've just started writing a SybaseAdaptorLayer... AOL uses Sybase for cer= tain > internal projects, and we will be using Modeling to develop some stuff for > them. I don't know Sybase at all, and have been reading the docs. Does an= yone > on the list have any experience, gotchas, wishlists for a Sybase adaptor = for > Modeling? >=20 > Sebastien, if it's useful, I'd be more than willing to donate the adaptor > layer once it's proven to work... This is great news and yes, a Sybase adaptor will certainly be useful. However, sorry, I've never used any sybase db server aither, so I've no experience to offer. But we can definitely work together to make it happen, esp. regarding testing and integrating it into the framework. Integrating a new layer in the framework means that we should be able to integrate it into the testing units, so we should also be able to deploy a dedicated db-server on the testing machines. With respect to these requirements, could you confirm that the testing components are the following? - Sybase Adaptive Server Enterprise 12.5.2 (http://www.sybase.com/detail?id=3D1030941) - Sybase module for Python (python DB API v2.0 compliant) (http://www.object-craft.com.au/projects/sybase/) (I picked up these after a quick google search, nothing more!) I can only test linux-based configurations; if you plan to use different components and/or different OSes, could you let us know? Looking forward to download the first draft of a Sybase adaptor ;), -- S=E9bastien. |
From: Sebastien B. <sbi...@us...> - 2004-07-29 08:30:36
|
Hi John, Again, could you be a little more explicit, or exhibit a short example? Sorry for getting back on this, but the only way I think this can happen is the one I already posted (see below); if it's not the case, this is a serious bug I definitely do not want to let escape. Thanks for your help! -- S=E9bastien. Sebastien Bigaret <sbi...@us...> writes: > John Lenton <jl...@gm...> wrote: > [...] > > actually, what's biting me is this (I'm translating from a different > > model into this one that is similar to the example, for clarity and > > brevity; I hope I don't muss ep): > >=20 > > >>> [i.getPerson().getId() for i in ec.fetch('Address')] > > [4, 5] > > >>> ec.fetch('Address', 'person.id =3D=3D 4') > > [] > >=20 > > in trying to simplify this last time I got the behaviour above, which > > I misinterpreted as the same thing. >=20 > Quickly replying here: this is absolutely not normal, and it would help > a lot if you could provide a sample model, code and data (sal dump is > ok). >=20 > Or maybe you were trying something like this? -> >=20 > >>> [i.getPerson().getId() for i in ec.fetch('Address')] > [4, 5] > >>> ec.fetch('Person', id =3D=3D 4') > [] >=20 > instead of: > >>> ec.fetch('Person', id =3D=3D 4', isDeep=3D1) # fetch the whole inheri= tce tree > [<PhysicalPerson instance at 0x...>] >=20 >=20 > -- S=E9bastien. |
From: Duncan M. <py...@ad...> - 2004-07-29 02:58:08
|
Hey folks, I've just started writing a SybaseAdaptorLayer... AOL uses Sybase for certain internal projects, and we will be using Modeling to develop some stuff for them. I don't know Sybase at all, and have been reading the docs. Does anyone on the list have any experience, gotchas, wishlists for a Sybase adaptor for Modeling? Sebastien, if it's useful, I'd be more than willing to donate the adaptor layer once it's proven to work... Thanks, Duncan |