Re: two different databases at same time?
Apparently I have complicated it by thinking of using multi ec to handle respective database connections. Thanks for clarification.. Cheers Cheong Hee - Original Message - From: "David LeBer" To: "Cheong Hee" Cc: "WO Dev Group" Sent: Thursday, April 01, 2010 8:23 PM Subject: Re: two different databases at same time? On 2010-04-01, at 12:07 AM, Cheong Hee wrote: Is there any pointers or sample code how these could be done to initiate connection and save changes in respective ec? You don't need multiple ec's unless you want them. Other than that it's transparent. EOEditingContext ec = ERXEC.newEditingContext(); Person p = (Person)EOUtitlites.createAndInsertInstance(ec, Person.ENTITY_NAME); // Person entity persists in database A Horse h = (Horse)EOUtitlites.createAndInsertInstance(ec, Horse.ENTITY_NAME); // Horse entity persists in database B // make chagnes to h and p ec.saveChanges(); // p saved to database A, h saved to database B You can model cross database relationships as long as you don't try and create a fetch based on them. Cheers Cheong Hee - Original Message - From: "Mark Ritchie" To: "James Cicenia" Cc: "WO Dev Group" Sent: Thursday, April 01, 2010 1:05 AM Subject: Re: two different databases at same time? On 31/Mar/2010, at 8:15 AM, James Cicenia wrote: Is it possible to use two different databases, I guess via two different models? I will need to connect to an Oracle big database on a remote server and was wondering if I could also use a mySQL or postgres database for user control on local server. Yes, yes! You can have multiple concurrent connections! One for each EOModel! Just make sure that the entity names are unique across all EOModels! Good luck! M. ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/chng34%40gmail.com This email sent to chn...@gmail.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/dleber_wodev%40codeferous.com This email sent to dleber_wo...@codeferous.com ;david -- David LeBer Codeferous Software 'co-def-er-ous' adj. Literally 'code-bearing' site: http://codeferous.com blog: http://davidleber.net profile: http://www.linkedin.com/in/davidleber twitter: http://twitter.com/rebeld -- Toronto Area Cocoa / WebObjects developers group: http://tacow.org ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Are you using scala + webobjects ?
On 25/03/2010, at 3:01 PM, André Mitra wrote: > Hello Dominique, > > At the moment, I am just experimenting with Scala and WO. Currently, WOLips > prefers Eclipse 3.4.x and Scala prefers 3.5.x, which can lead to different > annoyances depending on the version of Eclipse that you choose to use. And code completion afaik is better with scala 2.8 betas rather than 2.7.7 stable. with regards, -- Lachlan Deck ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Are you using scala + webobjects?
On 25/03/2010, at 1:24 PM, Ravi Mendis wrote: > Hi Dominique, > > Yes. I'm very busy (right now in fact!) deploying a concurrent WebObjects > application that uses Scala. > I'm hoping to present this as a case study for the "Scala & WO" track at this > year's WOWODC. > > In the meantime, i'm keeping notes on the wiki: > > http://wiki.objectstyle.org/confluence/display/WO/WebObjects+with+Scala > http://wiki.objectstyle.org/confluence/display/WO/Building+Concurrent+Applications+with+WebObjects+and+Scala > > On 25/03/2010, at 1:24 AM, dominique.schoenenber...@nagra.com wrote: >> Because you have suggested the use of Scala, I would like to ask you if you >> are using it in your WebObjects development ? >> >> I have started to use it, to investigate it and coded some Scala classes. >> It's nice, very expressive but it seems that the Eclipse plugin is not so >> good for the moment, the code completion is not working, the debug lacks >> some features and I have sometimes some problem to get my scala classes >> compiled in Eclipse: I have to make a change in the code (like adding a >> space character) in order to make it compiled. It's annoying. Have you had >> this problem ? What is your experience with Scala + WO ? > > One notable caveat is AFAIK the Scala Eclipse IDE still doesn't officially > support mixed Java + Scala projects. > (Importing Java libs or frameworks is fine. i.e you may factor out your Java > code into frameworks) > > If you do have mixed Java + Scala projects it works best if it's mostly one > or the other - like ying yang :) http://www.scala-tools.org/mvnsites/maven-scala-plugin/usage_java.html with regards, -- Lachlan Deck ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: subtotal question
On 25/03/2010, at 3:08 AM, James Cicenia wrote: > I see, that makes sense. I guess I thought there was someway to do it all in > the wod You talking about WODictionaryRepetition from JavaWOExtensions? http://developer.apple.com/legacy/mac/library/documentation/WebObjects/Reference/WOJExtensions/WOExtensions.pdf with regards, -- Lachlan Deck ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Problem with WebObjects in Jboss 5.1
On 24/03/2010, at 3:08 PM, Cheong Hee wrote: > Hi Andreas, > > I supposed whitespaces issue is always happened in WO/Windows regardless the > version. correct me if wrong. > > You may need to observe your deployment directory such as "C:\Tomcat 6.0" and > it has to change to "C:\Tomcat6.0" etc. This seemed to be your case. Also, > if you are going to maintain the wo application, you may want to consider: > 1. minor upgrade from WO5.2.3 to WO5.2.4. > 2. major upgrade from WO5.2.4 to WO5.4.3. 3. mostly minor upgrade from WO5.2.3 to WO5.3.3 in terms of compatibility. But similar development requirements to 5.4.x. > Case of major upgrade will require you to move development platform to > Eclipse/WOLips and maintain the WAR deployment. > > Cheers > > Cheong Hee > > - Original Message - From: "Henrique Prange" > To: > Sent: Tuesday, March 23, 2010 11:17 PM > Subject: Re: Problem with WebObjects in Jboss 5.1 > > >> Hi Andreas, >> >> On 22/03/10 12:09, Andreas S wrote: >>> Hello Henrique, >>> >>> our application uses WebObjects 5.2.3 under Windows Server 2008. >>> Wonder is not used. Our application is deployed as WAR within an EAR. >>> >> >> WebObjects 5.2.x and Windows... A dangerous combination. :) >> >> What is the complete path to where you have been deploying the EAR file? WO >> 5.2 has some bugs related with whitespaces on Windows. >> >> Cheers, >> >> Henrique >> ___ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >> Help/Unsubscribe/Update your Subscription: >> http://lists.apple.com/mailman/options/webobjects-dev/chng34%40gmail.com >> >> This email sent to chn...@gmail.com > > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/lachlan.deck%40gmail.com > > This email sent to lachlan.d...@gmail.com with regards, -- Lachlan Deck ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Snapshots mysteriously vanishing?
On Apr 1, 2010, at 5:24 AM, Marc Guenther wrote: Hi all, I spent quite some time now on this problem. I found a way to reproduce it, still I have no idea what to do about it. Can you share what that is? What I don't understand, if this is a known bug, and people are actually experiencing it, why have I never heard about it, and why is there no fix? This seems to be a major problem. I also found, that this also happens on WO5.2.3, which makes it even worse. I wonder why it has never bitten us before. Or maybe it has, but now some customer discovered some peculiar workflow which triggers this more often than usual. I don't recall seeing anything like this for a long time. I suspect that your customer theory may be true. Chuck James and Johann, (or everyone who has this problem), which version of WO are you using? Are we all talking about 5.4.3 here? On 25.03.2010, at 21:38, Mike Schrag wrote: I don't have a patch you can easily apply. The workaround on your side is to not let the EO in the parent EC garbage collect (basically, keep a reference to the parent EO around for any EO that you fault into child EC). Would a parentEC.setRetainsRegisteredObjects(true) help? Also there is a EODatabaseContext.disableSnapshotRefCounting() method, which completely disabled the refcounting mechanism. But I guess that would run out of memory very fast? There's not an easy recovery from this -- you have to toss your EC stack ... or .. maybe you could refetch the snapshot underneath it, but i think you're probably left with a __retainCount of -1 at that point, so probably even that won't help you. No, I don't want this to occur at all :) Have a happy easter, Marc I think this could be fixed pretty easily in wonder by overriding ERXGenericRecord.__setRetainCount .. When count is set >0, call back to your EC and retain the object in a dict and when it drops to 0, release that ref. On Mar 25, 2010, at 4:25 PM, Brook, James wrote: Mike, That sounds all too familiar to me. We are experiencing errors just like that. We have a feature that creates nested editing contexts several levels deep and fetches EOs all the way down to the bottom. Do you know of a workaround, patch or some way to recover from the bug you mention? I seem to remember a similar bug years ago in the days when EOF kept strong references. We are using Wonder. Sorry for selfishly jumping in. Disappearing snapshots are causing us lots of pain because whole instances of our application become useless. -- James From: webobjects-dev-bounces +jbrook=upcbroadband@lists.apple.com [webobjects-dev-bounces+jbrook=upcbroadband@lists.apple.com ] On Behalf Of Mike Schrag [msch...@mdimension.com] Sent: 25 March 2010 20:20 To: Marc Guenther Cc: webobjects-dev@lists.apple.com Subject: Re: Snapshots mysteriously vanishing? by any chance was this an EO in a parent editing context that also existed in a child editingcontext? I don't think so, but I'm not sure. That particular EO could have been in all differents ECs at the time, as it's entity is used all over the place. Do you have anything specific in mind? yeah, there's a bug with refcounting of eo's in child ec's if the parent ec copy of the EO gets garbage collected ... the result of this bug is disappearing snapshots. this specifically applies to eo's fetched into a child that were already fetched into the parent, though, not to peer ec's. ms ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/jbrook%40upcbroadband.com This email sent to jbr...@upcbroadband.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/yoda%40schli.ch This email sent to y...@schli.ch ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net This email sent to ch...@global-village.net -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjec
Re: Snapshots mysteriously vanishing?
i my own apps, i've never had this happen (at least not that i know of) ... so while i KNOW of such a bug, it doesn't mean it's easy to trigger. it requires a specific confluence of events to actually happen (at least the variant that i'm thinking of). if it's the problem i'm thinking of, parentEc.setRetainsRegisteredObjects would probably fix it (though I don't know if you can call that after the fact or if that only kicks in for objects AFTER that point). if you have a reproducible case of it, this would be an interesting test to run. you almost definitely will run out of memory if you turn off reference counting, though. my guess is your "some customer discovered some peculiar workflow" idea is most likely to be the case. also, my theory about fixing it in ERXGR __setRetainCount can't work because that method is final (gd final methods). i think this is probably only fixable with code injection. anjo pointed out that we DO make our own classloader in wonder startup, so we could ship gluonj in wonder and fix this. ms On Apr 1, 2010, at 8:24 AM, Marc Guenther wrote: > Hi all, > > I spent quite some time now on this problem. I found a way to reproduce it, > still I have no idea what to do about it. > > What I don't understand, if this is a known bug, and people are actually > experiencing it, why have I never heard about it, and why is there no fix? > This seems to be a major problem. > > I also found, that this also happens on WO5.2.3, which makes it even worse. I > wonder why it has never bitten us before. Or maybe it has, but now some > customer discovered some peculiar workflow which triggers this more often > than usual. > > James and Johann, (or everyone who has this problem), which version of WO are > you using? Are we all talking about 5.4.3 here? > > On 25.03.2010, at 21:38, Mike Schrag wrote: >> I don't have a patch you can easily apply. The workaround on your side is to >> not let the EO in the parent EC garbage collect (basically, keep a reference >> to the parent EO around for any EO that you fault into child EC). > > Would a parentEC.setRetainsRegisteredObjects(true) help? > > Also there is a EODatabaseContext.disableSnapshotRefCounting() method, which > completely disabled the refcounting mechanism. But I guess that would run out > of memory very fast? > >> There's not an easy recovery from this -- you have to toss your EC stack ... >> or .. maybe you could refetch the snapshot underneath it, but i think you're >> probably left with a __retainCount of -1 at that point, so probably even >> that won't help you. > > No, I don't want this to occur at all :) > > Have a happy easter, > Marc > >> I think this could be fixed pretty easily in wonder by overriding >> ERXGenericRecord.__setRetainCount .. When count is set >0, call back to your >> EC and retain the object in a dict and when it drops to 0, release that ref. >> >> On Mar 25, 2010, at 4:25 PM, Brook, James wrote: >> >>> Mike, >>> >>> That sounds all too familiar to me. We are experiencing errors just like >>> that. We have a feature that creates nested editing contexts several levels >>> deep and fetches EOs all the way down to the bottom. Do you know of a >>> workaround, patch or some way to recover from the bug you mention? I seem >>> to remember a similar bug years ago in the days when EOF kept strong >>> references. We are using Wonder. >>> >>> Sorry for selfishly jumping in. Disappearing snapshots are causing us lots >>> of pain because whole instances of our application become useless. >>> >>> -- >>> James >>> >>> From: webobjects-dev-bounces+jbrook=upcbroadband@lists.apple.com >>> [webobjects-dev-bounces+jbrook=upcbroadband@lists.apple.com] On Behalf >>> Of Mike Schrag [msch...@mdimension.com] >>> Sent: 25 March 2010 20:20 >>> To: Marc Guenther >>> Cc: webobjects-dev@lists.apple.com >>> Subject: Re: Snapshots mysteriously vanishing? >>> > by any chance was this an EO in a parent editing context that also > existed in a child editingcontext? I don't think so, but I'm not sure. That particular EO could have been in all differents ECs at the time, as it's entity is used all over the place. Do you have anything specific in mind? >>> yeah, there's a bug with refcounting of eo's in child ec's if the parent ec >>> copy of the EO gets garbage collected ... the result of this bug is >>> disappearing snapshots. this specifically applies to eo's fetched into a >>> child that were already fetched into the parent, though, not to peer ec's. >>> >>> ms >>> ___ >>> Do not post admin requests to the list. They will be ignored. >>> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >>> Help/Unsubscribe/Update your Subscription: >>> http://lists.apple.com/mailman/options/webobjects-dev/jbrook%40upcbroadband.com >>> >>> This email sent to jbr...@u
Re: two different databases at same time?
On 2010-04-01, at 8:38 AM, David Avendasora wrote: > > On Apr 1, 2010, at 8:23 AM, David LeBer wrote: > >> >> On 2010-04-01, at 12:07 AM, Cheong Hee wrote: >> >>> Is there any pointers or sample code how these could be done to initiate >>> connection and save changes in respective ec? >> >> You don't need multiple ec's unless you want them. Other than that it's >> transparent. >> >> EOEditingContext ec = ERXEC.newEditingContext(); >> Person p = (Person)EOUtitlites.createAndInsertInstance(ec, >> Person.ENTITY_NAME); // Person entity persists in database A >> Horse h = (Horse)EOUtitlites.createAndInsertInstance(ec, >> Horse.ENTITY_NAME); // Horse entity persists in database B >> // make chagnes to h and p >> ec.saveChanges(); // p saved to database A, h saved to database B >> >> You can model cross database relationships as long as you don't try and >> create a fetch based on them. > > I think you can fetch on them, you just can't qualify the fetch. It's an > all-or-nothing thing. Erm, yeah, that's what I meant. > You can't have cross-model inheritance structures either, I don't believe. > > Dave > >> >>> >>> Cheers >>> >>> Cheong Hee >>> >>> - Original Message - From: "Mark Ritchie" >>> To: "James Cicenia" >>> Cc: "WO Dev Group" >>> Sent: Thursday, April 01, 2010 1:05 AM >>> Subject: Re: two different databases at same time? >>> >>> On 31/Mar/2010, at 8:15 AM, James Cicenia wrote: > Is it possible to use two different databases, I guess via two different > models? > I will need to connect to an Oracle big database on a remote server and > was > wondering if I could also use a mySQL or postgres database for user > control > on local server. Yes, yes! You can have multiple concurrent connections! One for each EOModel! Just make sure that the entity names are unique across all EOModels! Good luck! M. ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/chng34%40gmail.com This email sent to chn...@gmail.com >>> >>> ___ >>> Do not post admin requests to the list. They will be ignored. >>> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >>> Help/Unsubscribe/Update your Subscription: >>> http://lists.apple.com/mailman/options/webobjects-dev/dleber_wodev%40codeferous.com >>> >>> This email sent to dleber_wo...@codeferous.com >> >> ;david >> >> -- >> David LeBer >> Codeferous Software >> 'co-def-er-ous' adj. Literally 'code-bearing' >> site:http://codeferous.com >> blog:http://davidleber.net >> profile: http://www.linkedin.com/in/davidleber >> twitter: http://twitter.com/rebeld >> -- >> Toronto Area Cocoa / WebObjects developers group: >> http://tacow.org >> >> >> >> >> ___ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >> Help/Unsubscribe/Update your Subscription: >> http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com >> >> This email sent to webobje...@avendasora.com >> >> > ;david -- David LeBer Codeferous Software 'co-def-er-ous' adj. Literally 'code-bearing' site: http://codeferous.com blog: http://davidleber.net profile:http://www.linkedin.com/in/davidleber twitter:http://twitter.com/rebeld -- Toronto Area Cocoa / WebObjects developers group: http://tacow.org ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Can an entity be promoted in single table inheritance?
Hi Kieran, Do you store the name of the java class or use a lookup hashmap or something else? Mark On 1 April 2010 11:52, Kieran Kelleher wrote: > For sure, Roles are the way to go, especially if someone can have more than > one Role (outside of the game of Chess, can a King also be a Knight? ;-) ) > However if your design really has only one Role and you don't want to or > can't change your database schema, you could drop the inheritance on those > entities and use the Strategy Design pattern to lazily instantiate composited > behaviours PeasantBehaviour, KingBehaviour, KnightBehaviour that all > implement the RoleBehaviour interface (in American english, drop the 'u' in > "behaviour".) You don't even need to change the current database. Just use > the current inheritance 'type' field to map to a RoleBehaviour class. and > now the RoleBehaviour becomes an attribute. The work involved is just EOModel > simplification and breaking out the behaviours into classes > > YMMV, Kieran > > > On Mar 31, 2010, at 10:48 PM, Ramsey Lee Gurley wrote: > >> I can't see this being possible in Vertical or Horizontal, but with single >> table... could the qualifying attribute be updated to 'promote' an entity to >> a new class? Let's say we have we have an abstract Person entity with three >> subclasses, Peasant, Knight, King. If I wanted to promote a knight to king, >> is it possible to simply update my type attribute from knight to king and >> EOF will start treating that record as a king instead of a knight? I would >> assume I would need to invalidate the existing knight object after saving >> changes so it could be refetched as a king... and if I had multiple >> instances, I'd need to invalidate it in those instances too... but is it >> possible? Or will EOF just flip out in the saveChanges() and refuse to do >> it? >> >> Just an academic question, of course (^_^) >> >> Ramsey ___ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >> Help/Unsubscribe/Update your Subscription: >> http://lists.apple.com/mailman/options/webobjects-dev/kieran_lists%40mac.com >> >> This email sent to kieran_li...@mac.com > > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/mark%40wardle.org > > This email sent to m...@wardle.org > > -- Dr. Mark Wardle Specialist registrar, Neurology Cardiff, UK ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: two different databases at same time?
On Apr 1, 2010, at 8:23 AM, David LeBer wrote: > > On 2010-04-01, at 12:07 AM, Cheong Hee wrote: > >> Is there any pointers or sample code how these could be done to initiate >> connection and save changes in respective ec? > > You don't need multiple ec's unless you want them. Other than that it's > transparent. > > EOEditingContext ec = ERXEC.newEditingContext(); > Person p = (Person)EOUtitlites.createAndInsertInstance(ec, > Person.ENTITY_NAME); // Person entity persists in database A > Horse h = (Horse)EOUtitlites.createAndInsertInstance(ec, > Horse.ENTITY_NAME); // Horse entity persists in database B > // make chagnes to h and p > ec.saveChanges(); // p saved to database A, h saved to database B > > You can model cross database relationships as long as you don't try and > create a fetch based on them. I think you can fetch on them, you just can't qualify the fetch. It's an all-or-nothing thing. You can't have cross-model inheritance structures either, I don't believe. Dave > >> >> Cheers >> >> Cheong Hee >> >> - Original Message - From: "Mark Ritchie" >> To: "James Cicenia" >> Cc: "WO Dev Group" >> Sent: Thursday, April 01, 2010 1:05 AM >> Subject: Re: two different databases at same time? >> >> >>> On 31/Mar/2010, at 8:15 AM, James Cicenia wrote: Is it possible to use two different databases, I guess via two different models? I will need to connect to an Oracle big database on a remote server and was wondering if I could also use a mySQL or postgres database for user control on local server. >>> >>> Yes, yes! You can have multiple concurrent connections! One for each >>> EOModel! >>> Just make sure that the entity names are unique across all EOModels! >>> Good luck! >>> M. >>> ___ >>> Do not post admin requests to the list. They will be ignored. >>> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >>> Help/Unsubscribe/Update your Subscription: >>> http://lists.apple.com/mailman/options/webobjects-dev/chng34%40gmail.com >>> >>> This email sent to chn...@gmail.com >> >> ___ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >> Help/Unsubscribe/Update your Subscription: >> http://lists.apple.com/mailman/options/webobjects-dev/dleber_wodev%40codeferous.com >> >> This email sent to dleber_wo...@codeferous.com > > ;david > > -- > David LeBer > Codeferous Software > 'co-def-er-ous' adj. Literally 'code-bearing' > site: http://codeferous.com > blog: http://davidleber.net > profile: http://www.linkedin.com/in/davidleber > twitter: http://twitter.com/rebeld > -- > Toronto Area Cocoa / WebObjects developers group: > http://tacow.org > > > > > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com > > This email sent to webobje...@avendasora.com > > ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Can an entity be promoted in single table inheritance?
I suspected as much, but I was curious and had to ask (^_^) Thanks to everyone for the replies! Ramsey On Mar 31, 2010, at 10:54 PM, Chuck Hill wrote: > > On Mar 31, 2010, at 7:48 PM, Ramsey Lee Gurley wrote: > >> I can't see this being possible in Vertical or Horizontal, but with single >> table... could the qualifying attribute be updated to 'promote' an entity to >> a new class? > > F**k No! > > Do NOT try this. Use the Role pattern or something that won't make EOF > insane. > > > >> Let's say we have we have an abstract Person entity with three subclasses, >> Peasant, Knight, King. If I wanted to promote a knight to king, is it >> possible to simply update my type attribute from knight to king and EOF will >> start treating that record as a king instead of a knight? I would assume I >> would need to invalidate the existing knight object after saving changes so >> it could be refetched as a king... and if I had multiple instances, I'd need >> to invalidate it in those instances too... but is it possible? Or will EOF >> just flip out in the saveChanges() and refuse to do it? >> >> Just an academic question, of course (^_^) > > > You could mybe get it to work if you invalidated enough things. But, > really, do you want hair on your palms? > > > Chuck > > > -- > Chuck Hill Senior Consultant / VP Development > > Practical WebObjects - for developers who want to increase their overall > knowledge of WebObjects or who are trying to solve specific problems. > http://www.global-village.net/products/practical_webobjects > > > > > > > smime.p7s Description: S/MIME cryptographic signature ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Snapshots mysteriously vanishing?
Hi all, I spent quite some time now on this problem. I found a way to reproduce it, still I have no idea what to do about it. What I don't understand, if this is a known bug, and people are actually experiencing it, why have I never heard about it, and why is there no fix? This seems to be a major problem. I also found, that this also happens on WO5.2.3, which makes it even worse. I wonder why it has never bitten us before. Or maybe it has, but now some customer discovered some peculiar workflow which triggers this more often than usual. James and Johann, (or everyone who has this problem), which version of WO are you using? Are we all talking about 5.4.3 here? On 25.03.2010, at 21:38, Mike Schrag wrote: > I don't have a patch you can easily apply. The workaround on your side is to > not let the EO in the parent EC garbage collect (basically, keep a reference > to the parent EO around for any EO that you fault into child EC). Would a parentEC.setRetainsRegisteredObjects(true) help? Also there is a EODatabaseContext.disableSnapshotRefCounting() method, which completely disabled the refcounting mechanism. But I guess that would run out of memory very fast? > There's not an easy recovery from this -- you have to toss your EC stack ... > or .. maybe you could refetch the snapshot underneath it, but i think you're > probably left with a __retainCount of -1 at that point, so probably even that > won't help you. No, I don't want this to occur at all :) Have a happy easter, Marc > I think this could be fixed pretty easily in wonder by overriding > ERXGenericRecord.__setRetainCount .. When count is set >0, call back to your > EC and retain the object in a dict and when it drops to 0, release that ref. > > On Mar 25, 2010, at 4:25 PM, Brook, James wrote: > >> Mike, >> >> That sounds all too familiar to me. We are experiencing errors just like >> that. We have a feature that creates nested editing contexts several levels >> deep and fetches EOs all the way down to the bottom. Do you know of a >> workaround, patch or some way to recover from the bug you mention? I seem to >> remember a similar bug years ago in the days when EOF kept strong >> references. We are using Wonder. >> >> Sorry for selfishly jumping in. Disappearing snapshots are causing us lots >> of pain because whole instances of our application become useless. >> >> -- >> James >> >> From: webobjects-dev-bounces+jbrook=upcbroadband@lists.apple.com >> [webobjects-dev-bounces+jbrook=upcbroadband@lists.apple.com] On Behalf >> Of Mike Schrag [msch...@mdimension.com] >> Sent: 25 March 2010 20:20 >> To: Marc Guenther >> Cc: webobjects-dev@lists.apple.com >> Subject: Re: Snapshots mysteriously vanishing? >> by any chance was this an EO in a parent editing context that also existed in a child editingcontext? >>> >>> I don't think so, but I'm not sure. That particular EO could have been in >>> all differents ECs at the time, as it's entity is used all over the place. >>> >>> Do you have anything specific in mind? >> yeah, there's a bug with refcounting of eo's in child ec's if the parent ec >> copy of the EO gets garbage collected ... the result of this bug is >> disappearing snapshots. this specifically applies to eo's fetched into a >> child that were already fetched into the parent, though, not to peer ec's. >> >> ms >> ___ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >> Help/Unsubscribe/Update your Subscription: >> http://lists.apple.com/mailman/options/webobjects-dev/jbrook%40upcbroadband.com >> >> This email sent to jbr...@upcbroadband.com > > > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/yoda%40schli.ch > > This email sent to y...@schli.ch ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: two different databases at same time?
On 2010-04-01, at 12:07 AM, Cheong Hee wrote: > Is there any pointers or sample code how these could be done to initiate > connection and save changes in respective ec? You don't need multiple ec's unless you want them. Other than that it's transparent. EOEditingContext ec = ERXEC.newEditingContext(); Person p = (Person)EOUtitlites.createAndInsertInstance(ec, Person.ENTITY_NAME); // Person entity persists in database A Horse h = (Horse)EOUtitlites.createAndInsertInstance(ec, Horse.ENTITY_NAME); // Horse entity persists in database B // make chagnes to h and p ec.saveChanges(); // p saved to database A, h saved to database B You can model cross database relationships as long as you don't try and create a fetch based on them. > > Cheers > > Cheong Hee > > - Original Message - From: "Mark Ritchie" > To: "James Cicenia" > Cc: "WO Dev Group" > Sent: Thursday, April 01, 2010 1:05 AM > Subject: Re: two different databases at same time? > > >> On 31/Mar/2010, at 8:15 AM, James Cicenia wrote: >>> Is it possible to use two different databases, I guess via two different >>> models? >>> I will need to connect to an Oracle big database on a remote server and was >>> wondering if I could also use a mySQL or postgres database for user control >>> on local server. >> >> Yes, yes! You can have multiple concurrent connections! One for each >> EOModel! >> Just make sure that the entity names are unique across all EOModels! >> Good luck! >> M. >> ___ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >> Help/Unsubscribe/Update your Subscription: >> http://lists.apple.com/mailman/options/webobjects-dev/chng34%40gmail.com >> >> This email sent to chn...@gmail.com > > ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/dleber_wodev%40codeferous.com > > This email sent to dleber_wo...@codeferous.com ;david -- David LeBer Codeferous Software 'co-def-er-ous' adj. Literally 'code-bearing' site: http://codeferous.com blog: http://davidleber.net profile:http://www.linkedin.com/in/davidleber twitter:http://twitter.com/rebeld -- Toronto Area Cocoa / WebObjects developers group: http://tacow.org ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
WOWODC 2010 registration is now open!
Hello everyone, WOWODC 2010 registration is now open! Check the details here : http://www.wocommunity.org/wowodc10/tickets.html -- Pascal Robert prob...@macti.ca WOWODC 2010 : August 27th-29th, Montreal. wowodc.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Can an entity be promoted in single table inheritance?
For sure, Roles are the way to go, especially if someone can have more than one Role (outside of the game of Chess, can a King also be a Knight? ;-) ) However if your design really has only one Role and you don't want to or can't change your database schema, you could drop the inheritance on those entities and use the Strategy Design pattern to lazily instantiate composited behaviours PeasantBehaviour, KingBehaviour, KnightBehaviour that all implement the RoleBehaviour interface (in American english, drop the 'u' in "behaviour".) You don't even need to change the current database. Just use the current inheritance 'type' field to map to a RoleBehaviour class. and now the RoleBehaviour becomes an attribute. The work involved is just EOModel simplification and breaking out the behaviours into classes YMMV, Kieran On Mar 31, 2010, at 10:48 PM, Ramsey Lee Gurley wrote: > I can't see this being possible in Vertical or Horizontal, but with single > table... could the qualifying attribute be updated to 'promote' an entity to > a new class? Let's say we have we have an abstract Person entity with three > subclasses, Peasant, Knight, King. If I wanted to promote a knight to king, > is it possible to simply update my type attribute from knight to king and EOF > will start treating that record as a king instead of a knight? I would > assume I would need to invalidate the existing knight object after saving > changes so it could be refetched as a king... and if I had multiple > instances, I'd need to invalidate it in those instances too... but is it > possible? Or will EOF just flip out in the saveChanges() and refuse to do it? > > Just an academic question, of course (^_^) > > Ramsey ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/kieran_lists%40mac.com > > This email sent to kieran_li...@mac.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Can an entity be promoted in single table inheritance?
Just say "NO". Seriously, I've tried this before - went with the roles paradigm and never looked back. Ken On Mar 31, 2010, at 10:48 PM, Ramsey Lee Gurley wrote: > I can't see this being possible in Vertical or Horizontal, but with single > table... could the qualifying attribute be updated to 'promote' an entity to > a new class? Let's say we have we have an abstract Person entity with three > subclasses, Peasant, Knight, King. If I wanted to promote a knight to king, > is it possible to simply update my type attribute from knight to king and EOF > will start treating that record as a king instead of a knight? I would > assume I would need to invalidate the existing knight object after saving > changes so it could be refetched as a king... and if I had multiple > instances, I'd need to invalidate it in those instances too... but is it > possible? Or will EOF just flip out in the saveChanges() and refuse to do it? > > Just an academic question, of course (^_^) > > Ramsey ___ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/kenlists%40anderhome.com > > This email sent to kenli...@anderhome.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com