Re: Different Database Connection per session for the same model

2012-06-18 Thread Lon Varscsak
Here's how I implemented it (it's actually quite simple): In Session.java: public ERXObjectStoreCoordinator defaultObjectStoreCoordinator() { return defaultObjectStoreCoordinator; } public void setDefaultObjectStoreCoordinator(ERXObjectStoreCoordinator defaultObjectStoreCoordinator) { if

Re: Question about "To Many" relationships hooks in ERRest

2012-06-18 Thread Pascal Robert
I think it was a problem in the past, but right now with my one-line fix, it works fine when I create or update a blog entry, and if I set setAnonymousUpdateEnabled(true) on the categories, it creates the category as expected. I'm going to commit it to the integration branch, if someone find a

Re: Different Database Connection per session for the same model

2012-06-18 Thread Alexis Tual
I agree, cross model relationships with different database connections shouldn't be used in real applications : eof bugs aside, there's one major problem : it's not transactionnal. Larry setup is interesting though, looks like the new old wo 4.5.1 :), the optimistic locking will work for sure ! Al

Re: Different Database Connection per session for the same model

2012-06-18 Thread Mike Gargano
those are definitely all problems i am currently facing. it's fine if everything is sequestered off into it own model, but relationships between them are not going to happen unless you manually manage what relationship's object gets pulled into what context. it's not manageable for any real-wo

Re: Different Database Connection per session for the same model

2012-06-18 Thread Ramsey Gurley
Speaking of which, I wonder what migrations do for cross db fks? Does it blow up trying to form a constraint? I'll have to look sometime. Which raises another interesting issue. Do you create cross model relationships Larry? I could see that causing problems. For example, create an EO in common

Re: Different Database Connection per session for the same model

2012-06-18 Thread Larry Mills-Gahl
Let me be more clear. It is possible to run migrations automatically but the different databases (whose connection dictionary is only known inside a session) will not all be automatically updated. I have migrations turned on and automatically connecting to (and updating) an empty database that

Re: Different Database Connection per session for the same model

2012-06-18 Thread Mike Gargano
it is. this is what i'm basically doing to on a per session basis -mike Sent from my iPhone On Jun 18, 2012, at 2:53 PM, Henrique Prange wrote: > Paul, > > Maybe this project can be helpful. I created it following Chuck's advice. > It's very experimental, but works. Sorry for the lack of co

Re: Different Database Connection per session for the same model

2012-06-18 Thread Larry Mills-Gahl
Not automatically. Migrations happen during the application startup and at that point, they have default connection dictionary information. I do use migrations but that just migrates the common databases and an empty stub database (that uses the default connection dictionary) on the main db ser

Re: Different Database Connection per session for the same model

2012-06-18 Thread Chuck Hill
IIRC, it is not handled. On 2012-06-18, at 1:43 PM, Ramsey Gurley wrote: > Out of curiosity, do you happen to know if it's possible to run migrations > against multiple data stores like you have Larry? > > Ramsey > > On Jun 18, 2012, at 1:25 PM, Larry Mills-Gahl wrote: > >> I do have an app

Re: Different Database Connection per session for the same model

2012-06-18 Thread Ramsey Gurley
Out of curiosity, do you happen to know if it's possible to run migrations against multiple data stores like you have Larry? Ramsey On Jun 18, 2012, at 1:25 PM, Larry Mills-Gahl wrote: > I do have an app with a different database connection per session. This does > appear to be relatively unch

Re: Different Database Connection per session for the same model

2012-06-18 Thread Larry Mills-Gahl
I do have an app with a different database connection per session. This does appear to be relatively uncharted territory, but it has been working in production for a while and it has been working pretty well. This is not a high volume transactional application. I use two models in this setup. O

Re: Custom Entity Classes

2012-06-18 Thread Pascal Robert
Le 2012-06-18 à 15:09, Ramsey Gurley a écrit : > > On Jun 18, 2012, at 11:42 AM, doug andrews wrote: > >> Our app currently does not use any of the Wonder frameworks at all. (It's >> big and was written over 10 years ago) >> I'd like to use ERXEC.newEditingContext(), as well as some of the ot

Re: Custom Entity Classes

2012-06-18 Thread doug andrews
OK. Thanks for the info Ramsey. On Jun 18, 2012, at 3:09 PM, Ramsey Gurley wrote: > > On Jun 18, 2012, at 11:42 AM, doug andrews wrote: > >> Our app currently does not use any of the Wonder frameworks at all. (It's >> big and was written over 10 years ago) >> I'd like to use ERXEC.newEditi

Re: Custom Entity Classes

2012-06-18 Thread Ramsey Gurley
On Jun 18, 2012, at 11:42 AM, doug andrews wrote: > Our app currently does not use any of the Wonder frameworks at all. (It's > big and was written over 10 years ago) > I'd like to use ERXEC.newEditingContext(), as well as some of the other > Wonder goodies. > I've never been able to get the e

Re: WOInject: harmed twice by classloader manipulation

2012-06-18 Thread Henrique Prange
Hi Joseph, This error occurs if you run the application through the Application's main method. The static initialization of the ERXApplication class triggers the load of the _NSUtilities class. You need to run the application from a separated class, like the AppRunner I've described, to ensure

Re: Different Database Connection per session for the same model

2012-06-18 Thread Henrique Prange
Paul, Maybe this project can be helpful. I created it following Chuck's advice. It's very experimental, but works. Sorry for the lack of comments in the source code. https://github.com/hprange/multi-tenant-prototype Cheers, Henrique On 18/06/2012, at 15:13, Chuck Hill wrote: > I have never d

Re: Custom Entity Classes

2012-06-18 Thread doug andrews
Our app currently does not use any of the Wonder frameworks at all. (It's big and was written over 10 years ago) I'd like to use ERXEC.newEditingContext(), as well as some of the other Wonder goodies. I've never been able to get the ec locking right on my own. I'd like to ease my way into this,

Re: Different Database Connection per session for the same model

2012-06-18 Thread Chuck Hill
I have never done this, but I think it can be done. You will need to create new EOModelGroups, load/copy the models from the default group, set the connection information, and create a new EOObjectStoreCoordinator from that new model group. You need to be very careful in your code (and in any

Re: Different Database Connection per session for the same model

2012-06-18 Thread Ramsey Gurley
You might find this helpful http://developer.apple.com/legacy/mac/library/#documentation/WebObjects/Enterprise_Objects/Connecting/Connecting.html#//apple_ref/doc/uid/TP30001011-CH210-BEDGBJJC Although some of the information there (providing multiple database channels) is wrong. databaseContext

Re: Different Database Connection per session for the same model

2012-06-18 Thread Mike Gargano
yes, look at chuck's book for fiddling with the connection dictionary Sent from my iPhone On Jun 18, 2012, at 12:32 PM, Paul Dunkler wrote: > Hi List, > > is there any way to have different database connections per session? I need > this in an application for giving the user the ability to ch

Re: Server not longer reachable because of 211GB logfile

2012-06-18 Thread probert
Envoyé de mon iPhone Le 2012-06-18 à 12:37, "Chuck Hill" a écrit : > As Pascal said, Nagios. And I would monitor the total amount of available > disk space. WO is not the only thing that can fill it up and kill the server. +1. No disk space left or no more swap memory are two common proble

Different Database Connection per session for the same model

2012-06-18 Thread Paul Dunkler
Hi List, is there any way to have different database connections per session? I need this in an application for giving the user the ability to change between several different copies of the database to work on. I always tried to copy EOModels and so on, read some mails from the list but not re

Re: Server not longer reachable because of 211GB logfile

2012-06-18 Thread Chuck Hill
As Pascal said, Nagios. And I would monitor the total amount of available disk space. WO is not the only thing that can fill it up and kill the server. Chuck On 2012-06-17, at 5:59 AM, ute Hoffmann wrote: > Hallo, > I have a Mac Os X server running a number of WebObjects Applications for tw

Re: Question about "To Many" relationships hooks in ERRest

2012-06-18 Thread George Domurot
It was my understanding that many-to-many relationships had to be handled "manually" due to them not being processed correctly by the framework. -G On Jun 18, 2012, at 7:52 AM, Pascal Robert wrote: > I'm working on my WOWODC slides, and I'm doing something that I didn't do for > many months:

Question about "To Many" relationships hooks in ERRest

2012-06-18 Thread Pascal Robert
I'm working on my WOWODC slides, and I'm doing something that I didn't do for many months: updating a 1:N (in fact, it's a N:N with a flatten relationship). So I have a blog entry which can have multiple categories, and I was doing an update to a blog post to add some categories, with: PUT /cgi

Re: Server not longer reachable because of 211GB logfile

2012-06-18 Thread Pascal Robert
Le 2012-06-17 à 08:59, ute Hoffmann a écrit : > Hallo, > I have a Mac Os X server running a number of WebObjects Applications for two > years now. > In the morning the server was no longer reachable via ssh or via Apache. > > The reason was a logfile of one Application instance which had the si