Re: [gentle-devel] Onto the subject of switching providers "on the fly", I just can't make a nice wr
Brought to you by:
mnmr
From: <mar...@gm...> - 2006-03-18 20:04:03
|
On Mar 13, 2006, at 2:01 AM, Morten Mertner wrote: > Hi Mart=EDn, > >> a) Would it be possible for Gentle to NEVER use the default provider? >> None, Ninguno, nessuno (?). Upon application Startup I'd like to >> create a PersistenceBroker and let all my objects use that. > > In theory, yes. In practise, however, it would be very hard to ensure. > I am hitting that wall=85 > The problem is that there are (too) many static method calls in =20 > Gentle, > or method calls in which not enough parameters are carried around > (usually a missing provider reference). If you come across one, let me > know and I'll make sure there is a way to supply the needed parameter. > I'd try, but I am stuck here=85 I don't know what to do. I will try to =20= expose my problem. > > >> Please notice how I have "commented" : base( broker ) because I am =20= >> not >> using BrokerLock. I want all my objects to be Unlocked; all the CRUD >> operations will always receive a PB object which has got to be =20 >> mandatory. >> >> Morten, am I heading in the wrong direction? > No, I think that should work. > except that I cannot make it work :p >> There's got to be a flaw in either my Factory or my Unlocked classes >> (or both?) because not only analysis is triggered twice (one for the >> normal app startup when loading Default Broker and one when I persist >> my 1st UnlockedPersistent); also this code seems to have no effect: > Did you find a fix for these issues, or does it still exist? Let me =20= > know > if you think it's a bug in Gentle. I have not. However, I have set up a simple "sample" with a mix of my =20= code and the ideas I've heard so far. The .zip file containing all the solution (including a db sample and =20 a nice readme) is at: http://www.dracula.com.ar/=20 ChangeMyProviderOhYay.zip The file is 850k in length and it includes all (gentle and log4net) =20 compiled. The Gentle version is the "latest" from source. (I may have =20= changed the version number, but bear in mind, it's the latest). Any Help will be appreciated, since I cannot find the "tricky" part =20 of gentle that keeps me from doing this. Thanks in advance, P.S.: please if you're going to use the sample, read the readme.txt =20 file which explains what to do, althought I tried to make this as =20 automatic as possible, you will need to execute a couple of Database =20 Scripts and modify the app.config. -- Mart=EDn Marconcini "Death is only a state of mind.Only it doesn't leave you much time to =20= think about anything else." |