Re: Content-type changing somewhere
Miguel, Totally weird, I just started having the same exact issue. I still haven't tracked down where the content type is getting changed, but I did find a workaround that seems to be holding for now (at least, it's a workaround for my problem). I was using response.setHeader (contentType, content-type. Notice the capitalization in the key. This worked just fine for years, but recently, it started yielding the exact behavior you are describing. My workaround was to change content-type to Content-Type. But it looks like you are already doing that, so there's probably something else going on here. If you find anything, please post it to the list and I will do the same. Thanks, Mark On Oct 12, 2007, at 2:37 PM, Miguel Arroz wrote: Hi! I'm setting up a component with an element inside, so that I can download a file. My problem is in the content type. On the element code, I do: response.setHeader(contentType, Content-Type); I'm absolutely sure that the content-type is being set to the Excel content type (I NSlogged it just above that line). When the browser receives it, the Content-type is back to plain text, and the file is saved as whatever.xls.html on Safari. On Firefox ir works, but Firebug shows the content type is not what I set it to be. As the headers are a dictionary, it's hard to watch for changes on the debugger. So, my question is, how can I track down who's changing my content type? Yours Miguel Arroz Miguel Arroz http://www.terminalapp.net http://www.ipragma.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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Improve Upload speed...
I agree with Simon. I used to try to use WebObjects for this kind of thing, but it is a never ending pain. EOF is especially terrible for that kind of task. If you can just write a perl script or something, things will go a lot easier (perl is great for this kind of task). If you have to have it in java, consider making a straight JDBC connection. I'm not sure if you can do inserts through EOUtilities.rawRowsForSQL, but I would try it. Otherwise, if you google around a bit you can find out how to push the raw SQL through EOAdaptorChannel. On Sep 26, 2007, at 6:15 AM, Shravan Kumar.M wrote: No! its Oracle 9i. effigent_logo.jpg Thank you, Shravan Kumar.M Effigent India www.effigent.com - On 26-Sep-07, at 3:43 PM, Andrew Lindesay wrote: Hello Shravan; We recently had a problem of not able to upload a file having 40K number of records from our WebObjects application to the database. We used to get java.lang.OutOfMemoryError after uploading Is MySQL involved per chance? cheers. ___ Andrew Lindesay technology : www.lindesay.co.nz business : www.silvereye.co.nz ___ 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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Deadlocks
You are probably safe for general EC usage there, but you can still do other bad things and end up deadlocked. There are many great things in the win column for WebObjects, but I believe one of the definite negatives of the technology is how ridiculously easy it is to deadlock a webobjects application. You have to take the bad with the good. This is miserably scary and nasty until you learn to dump the thread stack traces (see the URL Guido posted earlier: http://tinyurl.com/3bpkkv. Learning the tricks shown here cost me a week of sleep once, but now it's beautifully documented, so profit from the work people have done to write up these instructions). Once you have the stack traces in hand, it becomes pretty obvious where the problem is and you can fix it. Look for the thread which isn't stuck in a wait queue or sleeping while waiting for requests. Mark ___ 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 [EMAIL PROTECTED]
Re: Maybe No Need for a WOBuilder Replacement?
- the ability to cut or copy a whole group of elements and paste them somewhere else, bindings and all. If you use WOOgnl and inline bindings, you will have this ability within Eclipse's component editor. I think you will find that general readability of your components is much improved as well. I literally never put anything in a wod file any more, and that has made all the difference for me. But it's all just personal preference. Maybe try using WOOgnl and inline bindings and see if it addresses you concerns: http://wiki.objectstyle.org/confluence/display/WOL/Modern+Binding+Styles Mark ___ 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 [EMAIL PROTECTED]
Re: Maybe No Need for a WOBuilder Replacement?
For the record, I was trying to lend no comfort (cold or otherwise) by suggesting inline bindings. The tools are what they are. People were complaining about one aspect of the tool, and I offer inline bindings as a suggestion of what made that particular aspect of the tool workable for me, with the suggestion to try it and see if it had the same effect for you. I don't think anyone is calling anyone else slow or stupid or behind the times if they don't like the eclipse component editor. And certainly no one is trying to shove the eclipse component editor (which is apparently veal) down a vegetarian's (which is apparently the entire webobjects community) throat ;-p. But it is the accepted tool we have to work with, so it's nice to share tips about what helps and what has worked. No antagonism intended. On Sep 4, 2007, at 5:14 PM, Galen Rhodes wrote: That's the problem! It IS all about personal preference. No two people write code the same way. Just as people are individuals in their preference for color, clothes, music, whatever, people have preferences for how they write code! A good number of us became very use to working with WOBuilder and, yes, even got use to it's many quirks. What's faster for one person may very well be slower for others simply because we're use to working in a different way. For some of us who were use to WOBuilder, having to use Eclipse is like going from JEdit back to using VI. And telling us to try changing the paradigm even more by switching to inline bindings is cold comfort. You may as well be telling a lifelong vegetarian to just shut up and try the veal. -- Galen Rhodes [EMAIL PROTECTED] On Sep 4, 2007, at 4:42 PM, Mike Schrag wrote: - the ability to see, in a graphical way, what components are contained in other components, what they are, and (for simple things like conditionals), what their main binding is. Using WOBuilder with a complex component I can see what I need in less than a second, while it sometimes takes minutes in Eclipse to do the same thing. Although viewing tables is much easier this way, that's not the important thing. I don't need to see how the page will look-- I want to see the component hierarchy in a graphical way. Just personal preference on this one ... I find the exact opposite. We don't do almost any table layout, and opening a complex css-laid-out component in WOBuilder appears to me to be unintelligible. Component editor in Eclipse shows both an outline view of your components as well as the collapsible HTML editor with rollovers that show the span of each tag. But this has been debated to death, so I'm leaving this at personal preference. - the ability to cut or copy a whole group of elements and paste them somewhere else, bindings and all. This could definitely be added into component editor ... I can pretty easily, I think, track the associated wod bindings when you cut HTML and autocut/copy related wod entries. 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/grhodes% 40thissmallworld.com This email sent to [EMAIL PROTECTED] ___ 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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: setting default order of entity fetches
For Wonder users, you can do all kinds of neat things with ERXArrayUtilities and key-value coding: http://wiki.objectstyle.org/confluence/display/WO/ Programming__WebObjects-WOnder-ERXArrayUtilities This allows you to do things like quickly and easily sort in your bindings: list = [EMAIL PROTECTED],firstName There are tons of neat things you can do besides sorting (and you can extend it to do still other things), but this thread made me think of the sorting functionality (although I'm not clear if it useful for solving the problem that started the thread). Mark On Aug 22, 2007, at 10:40 PM, Ken Anderson wrote: To me, sorting is something that should really occur at the UI or 'use' level. Also, if you consider the amount of CPU needed to sort the EOs returned to you, it's probably comparable to what the DB has to do anyway, so why not distribute it? On Aug 22, 2007, at 9:22 PM, Lachlan Deck wrote: On 23/08/2007, at 10:46 AM, Chuck Hill wrote: On Aug 22, 2007, at 5:09 PM, Lachlan Deck wrote: Hi there, EOEntity has a restrictingQualifier that's applied to every fetch for the relevant entity. Is there any similar mechanism for installing a default ordering for fetched objects of each entity (e.g., when following a toMany relationship)? Or any delegate methods somewhere? No. And don't override the EOF methods to do this or you risk messing with EOF. And we all know how that ends up. :-) The reason for the lack of sorting, as I understand it, is that EOF would then need to keep the list sorted each time something was added to it. It's already keeping them sorted (think about it...). Just not how I'd like. Furthermore, it's impossible to fetch records from a database without them sorted in some kind of order. I'm simply wanting to override the arbitrary sort order that the database wants to return to suit this particular application. And what if you wanted alternate sorts? Simply apply the default sorting in the absence of a specific sort orderings array. Not hard conceptually. The standard approach is to have a cover method that sorts the contents of the relationship and returns it. Which kinda makes *every* toMany relationship generated from each EOEntity useless don't you think? 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/kenlists% 40anderhome.com This email sent to [EMAIL PROTECTED] ___ 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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Using WO components inside HTML tags
Another possibility, if you use WOOgnl, is to add the following to your properties file: ognl.parseStandardTags=true Now you can do things like td bgcolor=$myColorVariable http://wiki.objectstyle.org/confluence/display/WOL/Modern+Binding+Styles http://wiki.objectstyle.org/confluence/display/WO/ Programming__WebObjects-Project+WONDER-Frameworks-WOOgnl On Aug 17, 2007, at 11:11 AM, Kieran Kelleher wrote: Use WOGenericContainer of type td and then add a bgcolor binding to it. That is the preferred way AFAIK to avoid tag within a tag. This, I believe, is the primary raison d'ĂȘtre for WOGenericElement and WOGenericContainer. HTH, Kieran On Aug 17, 2007, at 10:58 AM, Pascal Robert wrote: Ok, I know it's a basic question, but what's the best way to include a WO component (in that case, a WOString) inside a HTML page ? I need to change the background color of a td with the value of a WOString, something like this : td bgcolor=webobject name = Couleur/webobject/td I know it's bad pratice, so what's the fix ? ___ 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 [EMAIL PROTECTED] ___ 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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Which way is more efficient to get particular EOEnterpriseObject
ditto for me. My early code is littered with tons of complex data structures (dictionaries, arrays of arrays, lists, etc) created with the intent of diminishing performance overhead. I have come to believe that the best strategy you can take for something like this is just to build it the easiest way first, and if it's miserably slow, find the bottlenecks and fix them. If it isn't slow, you have more maintainable code and you didn't waste any time optimizing unnecessarily. Mark On Aug 16, 2007, at 8:17 AM, James Cicenia wrote: When I first started with WebObjects I was very worried about all the overhead of creating EOs, etc. Well like some said here,, build it the easy way using WO and see if you really need to optimize. I use filtered arrays on relationships all the time and it works really well. I easily have over 100 related objects though not 1000s. WebObjects has been an excellent performer and has scaled very linearly for us too. So, build it using WO as easy as possible and then really see if you need to optimize. James ___ 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 [EMAIL PROTECTED]
Re: Which way is more efficient to get particular EOEnterpriseObject
Hi Pierre, Can you elaborate on stale cache notification a bit, or else point us to some documentation on it? Thanks, Mark You can listen to EOF notifications to see when your cache goes stale. Pierre ___ 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 [EMAIL PROTECTED]
Re: log4j initialization problem
Don't leave us hanging ;-) What was the fix? On Aug 15, 2007, at 12:04 PM, James Cicenia wrote: never mind. On Aug 15, 2007, at 10:22 AM, James Cicenia wrote: Hello - I am now getting serious. ;-) I want to use logging and in particular log4j. In my Application constructor I have: String log4jFile = resourceManager().pathURLForResourceNamed (log4j.properties, null, null).toString(); then I have: System.out.println(Log4j file (from .woa): + log4jFile); PropertyConfigurator.configure(log4jFile); log = Logger.getLogger( Application.class ); log.debug(Log4j has been initialized); And I get this outputed in my current log: Log4j file (from .woa): file:/usr/local/apple/Library/WebObjects/ Applications/Blakey.woa/Contents/Resources/log4j.properties log4j:ERROR Could not read configuration file [file:/usr/local/ apple/Library/WebObjects/Applications/Blakey.woa/Contents/ Resources/log4j.properties]. java.io.FileNotFoundException: file:/usr/local/apple/Library/ WebObjects/Applications/Blakey.woa/Contents/Resources/ log4j.properties (No such file or directo ry) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.init(FileInputStream.java:106) at java.io.FileInputStream.init(FileInputStream.java:66) at org.apache.log4j.PropertyConfigurator.doConfigure (PropertyConfigurator.java:297) at org.apache.log4j.PropertyConfigurator.configure (PropertyConfigurator.java:315) at com.tos.Application.init(Application.java:242) HOWEVER that file referenced is there and with completely opened permissions (777) What obvious thing am I doing wrong? Thanks James Cicenia ___ 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/james% 40jimijon.com This email sent to [EMAIL PROTECTED] ___ 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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: WOFileUpload + Safari 3 Beta
Hi Clark, I know there is some stupid hack that I don't really understand that fixes your particular problem (No form data left for WOFileUpload). You can set a system property in the following way: System.setProperty( WOUseLegacyMultipartParser, YES ); and the problem will probably go away. Be warned though, there are some places where this seems like a bad idea. I recently lost a good half day trying to get AjaxUploadComponent to work. The key to fixing it? Remove the line I just mentioned above. Does anyone on the list actually understand the underlying issues here? I've always been curious, but never had time to dig. Mark On Aug 1, 2007, at 10:00 PM, Clark Mueller wrote: I should also mention... my enctype is set to multipart/form- data, and I get a stack trace that says: [2007-08-01 19:59:46 MDT] WorkerThread0 com.webobjects.appserver._private.WOComponentRequestHandler: Exception occurred while handling request: java.lang.IllegalStateException: com.webobjects.appserver._private.WOFileUpload No form data left for WOFileUpload! Clark ___ 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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: WebObjects documentation site
Hi Andrew, When you say typographical elements, what do you mean? Can you give me a specific example of what is different between the two wikis for the page you linked to (at first glance, I can't see any differences between the confluence wiki entry and the wikibook entry)? Also, I haven't had time to look into image exports (I wasn't sure if there were even that many pages in the wikibook with images). If you can give me an example of a page with images, I'll start digging around for how to move all of the images over. Thanks, Mark On Jul 8, 2007, at 6:16 PM, Andrew Lindesay wrote: Hello Steven; Thanks for undertaking that migration. Unfortunately many of the typographical elements are broken in documents such as; http://wiki.objectstyle.org/confluence/display/WO/ Programming__WebObjects-EOF-Modeling-Entities As well as this, images are missing that were present in the WikiBook. If there is nothing that can be done about this then it will have to wait until I have time to re-format all of the documents I entered, otherwise if something can be done then this would save a significant amount of work. cheers. If there is agreement from everyone that everything has been moved over correctly, we will totally disable the wikibooks wiki (except for a note pointing to objectstyle.org) in a week or so to avoid future confusion over the best place for documentation. ___ Andrew Lindesay technology : www.lindesay.co.nz business : www.silvereye.co.nz ___ 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 [EMAIL PROTECTED]
Re: WOBuilder Replacement
I'm kicking my own ass for keeping this thread going, but I couldn't resist. Until about a year ago, I was pretty dependent on WO Builder, just because I'd never put together templates any other way, so I know how a lot of the people who are complaining that there is no rendering previewish editor feel. But in truth, WO Builder forced me into some pretty sloppy HTML and haphazard templating, and I never would have realized that if I hadn't switched to editing the HTML by hand. It was a little bumpy for a while, but honestly now that I'm used to it, I wouldn't use a WO Builder like tool even if one were available. I just feel like a better coder now, and things make more sense in a lot of places, and I'm really expanding in terms of my usage of HTML/CSS (Having a visual tool kept me stuck in the world of always using tables for layout, etc). When you have to look at the HTML, you suddenly discover a lot of ways to make things better. So I encourage anyone writing in who can't bear the thought of not having WO Builder to bite the bullet and try using the WOLips component editor for a month and see what happens. If you still hate it, go back to using WO Builder. There's no reason you can't use WO Builder and Eclipse together, although the integration isn't quite as good as it was with XCode (because when you make a change, you have to go back to Eclipse and refresh the component there before the change will show up in your running app). Mark On Jul 6, 2007, at 5:36 PM, Chuck Hill wrote: On Jul 6, 2007, at 2:07 PM, Louis Demers wrote: On 6-Jul-07, at 16:33 , Andrew Lindesay wrote: Hello Janine; The only feature of WOBuilder that I consider important is the one that helps you to visualize what your component will look like when it's rendered. WOBuilder always did a lousy job of this, especially It's interesting; we all have quite different ways of working with components which probably illustrates different ways of thinking. I really do like Mike's component editor, but to augment it, I would also enjoy the visual modeller in WOB. I really do not feel at all like I need a full render of the page with data or anything -- what WOB does is perfect for my use. It's really a logical view for making bindings. I'd love to have the time for such an undertaking. :-/ You expressed exactly what I was trying to say. Indeed, I believe that the graphical presentation must not aim at the aesthetics of the page/component but rather it's structure along with a decent inspector for the available bindings. The aesthetics of the presentation should be done through CSS and could be handed off to other tools like CSSEdit and the like. In a sense, couldn't it be structured like the eomodeler in eclipse ? A tree showing the structure and some inspector specific to the webobject tags being edited ? Two thoughts: 1. If you have clean, well formatted HTML the structure is usually evident. Even with larger forms and tables, the ability to collapse sections can still make it easy to see. Or, like Mike posted, you can use the Outline view. Yes, Eclipse is amazing. 2. There is already an inspector (of sorts) for the WO tag being edited. Click on the tag in the HTML and the WOD portion automatically scrolls to the definition in the WOD. Ctrl-space in the definition to see all bindings ( foo =). Adding an inspector is probably not too much work, though perhaps of little benefit once you have gotten used to auto-complete. So it is not really too far off what you want with no real need for a full blown WO Builder. Chuck -- 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 (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/mark% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: WOBuilder Replacement
Galen, Take some slow deep breaths before your head explodes. Here's the beauty of an open source project for you: you don't have to use it. If you think it isn't meeting your needs, run along and pay for something that will. If wonder dies, it dies, but right now a lot of people see it as very useful and beneficial, even if you don't. And if you don't, that's totally fine. If you don't see it as beneficial, don't use it. It's hard to feel ripped off if a volunteer open-source community creates something that you don't like, and you shouldn't get super angry if they don't take the project (or, especially, some small aspect of the project) in the direction you want it to go in. Mark On Jul 5, 2007, at 5:07 PM, Galen Rhodes wrote: On Jul 5, 2007, at 4:36 PM, Chuck Hill wrote: * SNIP * I doubt that very much. The development to date has been developers building what _they_ personally need to get their job done. Most of what is in Entity Modeler and WOComponent Editor are things that Mike need to do his job more efficiently. He, and mDimension, were kind enough to donate the results. As long as we WO developers have unmet needs, development will continue. It may happen in fits and bursts as our needs dictate, but it will happen. It will only stagnate if all of our needs are met (or if those with needs are too damn lazy to do anything about them). And in that case, it will be more of stable than stagnant. * SNIP * Or make their work on projects that make money more efficient. Don't forget that. Money does not need to be made directly. And this is the primary reason, IMHO, why WOComponent Editor is not WYSIWYG. A developer set out to make something that would be very efficient to use while requiring less effort than it would save. I think that Mike has succeeded admirably in this. While it is not flashy, it is far more productive for me than WOBuilder ever was and I am FAR happier using it than I was using WOBuilder. Too many people seem to be more concerned with which font is used or IDE layout, or cute drag and drop tricks than they are with actual, real life productivity. OK, enough of that rant... Your two statements really made my point for me. Your needs are not the same as someone else's needs. This is probably the #1 problem with the OpenSource community is that they develop software for themselves and not others. They develop software to meet their needs and not anyone else's needs. Which I think is probably why they never make any money off of their labors. And I personally LOVE your extremely insulting line of or if those with needs are too damn lazy to do anything about them. Wow! I mean WOW! Arrogance is always my favorite sin! Remember the old saying, Pride goeth before the fall? So what you're saying is that I'm a lazy bastard if I don't have time to develop the tools myself? WOW! That attitude is exactly what is going to kill WO off for good. I've said it before, you develop a WYSIWYG replacement for WOBuilder and EOModeler I'll pay upwards of $500 for them. That's not a small amount of money! But you know what? I'll save three times that much in a year over having to use the current WOLips tools! You may not desire WYSIWYG because it slows _YOU_ down. But there may be others that truly feel that WYSIWYG enhances _THEIR_ productivity. And your refusal to accept that is EXACTLY what is wrong with OpenSource projects. The developers adopt a very arrogant view that what's good for them is good for everyone. ___ 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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Complex EOQualifier format
Hi all, Does anyone know why I can't build an arbitrarily complex qualifier with EOF? The following code CCGGregorianCalendar now = new CCGGregorianCalendar(); now.setMonth(now.getMonth() + 3); args.addObject(now.timestamp()); args.addObject(new NSTimestamp()); String qualString = (POW((69.1 * ( location.longitude - + zipCode.longitude() + ) * cos( + zipCode.latitude() + / 57.3)), 2) + + POW((69.1 * ( location.latitude - + zipCode.latitude() + )), 2)) + _selectedMileageOption.intValue() * _selectedMileageOption.intValue() + and bidCloseDate = %@ and bidCloseDate %@; EOQualifier qual = EOQualifier.qualifierWithQualifierFormat (qualString, args); Produces [2007-07-04 14:52:56 EDT] WorkerThread6 com.webobjects.foundation.NSForwardException for com.webobjects.eocontrol._private.ParseException: Encountered ( at line 1, column 5. Was expecting one of: IDENTIFIER ... ARGUMENT_PATH ... = ... = ... = ... = ... ... != ... = ... ... ... at com.webobjects.eocontrol._private._EOQualifierParser.generateParseExcept ion(_EOQualifierParser.java:1044) at com.webobjects.eocontrol._private._EOQualifierParser.jj_consume_token (_EOQualifierParser.java:980) at com.webobjects.eocontrol._private._EOQualifierParser.parseOperatorList (_EOQualifierParser.java:562) at com.webobjects.eocontrol._private._EOQualifierParser.RelOpExpression (_EOQualifierParser.java:638) at com.webobjects.eocontrol._private._EOQualifierParser.Expression (_EOQualifierParser.java:594) at com.webobjects.eocontrol._private._EOQualifierParser.parseLogicalExpress ion(_EOQualifierParser.java:872) at com.webobjects.eocontrol._private._EOQualifierParser.ParenExpression (_EOQualifierParser.java:616) at com.webobjects.eocontrol._private._EOQualifierParser.Expression (_EOQualifierParser.java:598) at com.webobjects.eocontrol._private._EOQualifierParser.parseLogicalExpress ion(_EOQualifierParser.java:872) at com.webobjects.eocontrol.EOQualifier.qualifierWithQualifierFormat (EOQualifier.java:941) ... Do I just give up here and fetch raw rows with a pre-build SQL string, and then use the PK to fetch in the EO when I need it? It's seems super lame to me that EOQualifier can't parse something with parentheses, but maybe I'm missing something obvious. Mark ___ 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 [EMAIL PROTECTED]
Re: Complex EOQualifier format
Okay, after googling for another half hour or so, I think I can answer my own question. You absolutely cannot use EOQualifier to fetch EOs with an expression like the one I want to write. Apparently EOF considers even subtraction to be a database specific task, and I guess the thought is that somehow this ruins database independence. You could theoretically use 'setHints' on your fetch specification, but to do that you have to build a full query string anyway, and have all of the attributes present in the exact order that EOF expects them in (and God only knows what that is... plus if you change your model by adding or deleting a column, you have to remember to go back and change your hints, I assume). This does not seem worth the hassle to me. I am just going to convert my complex qualifier construction code so that it instead constructs a raw sql string (which will be more efficient anyway, as it only fetches the columns I want to display, plus gives me the flexibility to do arithmetic within my query string), and then fetch raw rows. On Jul 4, 2007, at 3:00 PM, Steven Mark McCraw wrote: Hi all, Does anyone know why I can't build an arbitrarily complex qualifier with EOF? The following code CCGGregorianCalendar now = new CCGGregorianCalendar(); now.setMonth(now.getMonth() + 3); args.addObject(now.timestamp()); args.addObject(new NSTimestamp()); String qualString = (POW((69.1 * ( location.longitude - + zipCode.longitude() + ) * cos( + zipCode.latitude() + / 57.3)), 2) + + POW((69.1 * ( location.latitude - + zipCode.latitude() + )), 2)) + _selectedMileageOption.intValue() * _selectedMileageOption.intValue() + and bidCloseDate = %@ and bidCloseDate %@; EOQualifier qual = EOQualifier.qualifierWithQualifierFormat (qualString, args); Produces [2007-07-04 14:52:56 EDT] WorkerThread6 com.webobjects.foundation.NSForwardException for com.webobjects.eocontrol._private.ParseException: Encountered ( at line 1, column 5. Was expecting one of: IDENTIFIER ... ARGUMENT_PATH ... = ... = ... = ... = ... ... != ... = ... ... ... at com.webobjects.eocontrol._private._EOQualifierParser.generateParseExce ption(_EOQualifierParser.java:1044) at com.webobjects.eocontrol._private._EOQualifierParser.jj_consume_token( _EOQualifierParser.java:980) at com.webobjects.eocontrol._private._EOQualifierParser.parseOperatorList (_EOQualifierParser.java:562) at com.webobjects.eocontrol._private._EOQualifierParser.RelOpExpression (_EOQualifierParser.java:638) at com.webobjects.eocontrol._private._EOQualifierParser.Expression (_EOQualifierParser.java:594) at com.webobjects.eocontrol._private._EOQualifierParser.parseLogicalExpre ssion(_EOQualifierParser.java:872) at com.webobjects.eocontrol._private._EOQualifierParser.ParenExpression (_EOQualifierParser.java:616) at com.webobjects.eocontrol._private._EOQualifierParser.Expression (_EOQualifierParser.java:598) at com.webobjects.eocontrol._private._EOQualifierParser.parseLogicalExpre ssion(_EOQualifierParser.java:872) at com.webobjects.eocontrol.EOQualifier.qualifierWithQualifierFormat (EOQualifier.java:941) ... Do I just give up here and fetch raw rows with a pre-build SQL string, and then use the PK to fetch in the EO when I need it? It's seems super lame to me that EOQualifier can't parse something with parentheses, but maybe I'm missing something obvious. Mark ___ 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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Complex EOQualifier format
On Jul 4, 2007, at 5:15 PM, Pierre Bernard wrote: I feel the urge to voice opinions about this. - EOF is an ORM not a SQL generator. Its task is to allow you to work in a pure OO work and make object graph management and persistent transparent. Meaning: you want to do your processing in Java, not in the database. I can appreciate this, but there are times when you absolutely cannot do your processing in Java. The example I posted earlier (which fetches geographical points within a certain distance of other geographical points) is a perfect example. You can do this in the database and have a response to your users within seconds, or you can do it in java and have a response to your users in minutes. It would appear that the option you are left with here is fetching raw rows. - You are free to extend EOF's magic by writing custom qualifiers. I have some on my web site: http://www.bernard-web.com/pierre That sounds like a neat idea, but I don't really know how you would go about it. I downloaded your code just now and will have a look when I have more time. - qualifierWithFormat() is evil. The qualifier string cannot be validated by the compiler. You are tempted to write out attribute names in String, thus making future evolutions of the model difficult. It is almost like writing SQL How do you create your qualifiers if not with qualifierWithQualifierFormat? ___ 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 [EMAIL PROTECTED]
Re: Complex EOQualifier format
I see! I'd wondered why those constants were getting tossed in there. That's very fancy! Thanks guys! Mark On Jul 4, 2007, at 5:44 PM, Ken Anderson wrote: Are you using EOGenerator? It creates constants for you for all the names of your attributes. So, you would construct one like this: EOKeyValueQualifier qualifier = new EOKeyValueQualifier (User.LastNameKey, EOQualifier.QualifierOperatorEqual, McCraw); If you modify your model, EOGenerator will update the constants, and your code will no longer compile. If you're using Eclipse and WOLips, this pretty much happens automatically and then you can just refactor. Ken On Jul 4, 2007, at 5:37 PM, Steven Mark McCraw wrote: In a previous post, it was mentioned that The qualifier string cannot be validated by the compiler. You are tempted to write out attribute names in String, thus making future evolutions of the model difficult. It is almost like writing SQL It looks like EOKeyValueQualifier still takes the attribute name as a string in its constructor. How would the compiler validate your (possibly changed) attribute names even if you weren't using qualifierWithQualifierFormat? On Jul 4, 2007, at 5:31 PM, Ken Anderson wrote: You create them using instances of EOKeyValueQualifier, EOAndQualifier, EOOrQualifier, etc. All qualifierWithQualifierFormat does is build this structure for you... sometimes poorly. On Jul 4, 2007, at 5:28 PM, Steven Mark McCraw wrote: How do you create your qualifiers if not with qualifierWithQualifierFormat? ___ 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 [EMAIL PROTECTED]
WebObjects documentation site
Hi all, A small group of people have begun to look into the problem of lack of good, easy to use documentation for WebObjects and wonder, and based on feedback from the developer lists, we have created spaces at http://wiki.objectstyle.org/confluence/display/WO/Home for the documentation. Right now those spaces are all empty, and almost none of them have been claimed by an author to fill them. We are hoping that people will see a topic that they know a great deal about already or want to learn a great deal about, and fill in the gaps. If you've already written something on a topic, please post it here. The speed of this process depends on the willingness of the community at large. If just a small handful of people are committed, it will take a very long time to get a useful consolidated reference library in place, and we run the risk of the technology developing faster than the documentation. However, if everyone steps up and contributes even a little bit, we will quickly catch the documentation up to the technology, and develop a great resource that everyone benefits from. This is everyone's opportunity to contribute to the community that they already benefit from. There are plenty of good reasons to contribute to this effort: It's a great way to say thanks to all of the people who have sacrificed their time and resources to create, free of charge to you, a codebase that enables you to remain up to date and competitive in the web application marketplace while still using WebObjects. It's a great way to exchange information: in return for taking 8 or 9 hours to write a good article on something you already understand well, you get to digest information on a topic you know nothing about in a fraction of the time you otherwise would have had to spend to learn it. If you were willing to spend thousands of dollars for a trip to San Francisco to attend a developers conference which had only a tiny amount of time to present cutting edge information, surely you can spare a work day or two (or a week of evenings perhaps) contributing information to a resource which makes all of this information available to others (and yourself) at a pace that's easy to digest, and a breadth that could never be covered at a single conference. There are even valid selfish reasons to contribute. If you know nothing at all about a specific topic, writing an article on it is a great way to focus your attention to learn it. If you know only a bit about a topic, by the time you finish authoring a well constructed how-to in print, you will know it extremely well. You will gain respect and gratitude from the community, and it reflects well on the community as a whole. And if everyone does their share, you'll be able to learn from others on any topic you need to know about without having to do it the hard way (endless googling + trial and error). If everyone tries to help, then the jobs and lives of everyone who develops with WebObjects will be happier and more productive. Finally, please do not feel that you are too limited in your capacities to make a worthwhile contribution. Any sincere attempt to contribute is better than no attempt to contribute. The wiki and all its new entries are being monitored by people who have been programming with WebObjects for close to a decade now, and by the authors of project wonder. If you make a mistake in your documentation, it will be caught and corrected quickly. We are asking people to denote that they are working on an article before they start writing it, so that we won't be duplicating each other's efforts (it's a big enough task if you only do it once!). Therefore, we ask that before you claim a topic, you ensure that you have the time and resources available to compose it in a timely fashion (say, two weeks?). We just don't want willing people to avoid authorship of a topic because someone has already claimed it, and the claiming person is never actually getting around to doing it. To contribute to the wiki, you will need to set up an account. Just go to http://issues.objectstyle.org/jira/secure/Signup!default.jspa to create that account. When you have chosen a topic that you want to write on, edit the entry for that topic and change the '**' on the end to '(under construction)'. As soon as you have your article in place, you can just remove the '(under construction)' from the title. A large amount of information on many of these topics already exists here and there about the web, and we are hoping to collect it all here in the form of easy to understand step by step how-to guides. If you claim a topic, please feel free to incorporate any of the information which already exists at http://en.wikibooks.org/wiki/ Programming:WebObjects (the reason we are not simply expanding this site is that there was a strong consensus that
Re: [Wonder-disc] WebObjects documentation site
Hi Kieran, Starting at the top (aka root, dashboard) are these the final categories of info? http://wiki.objectstyle.org/confluence/dashboard.action Really, these are more of a starting point. At the moment, we're kind of directing our efforts towards the WebObjects space (which should contain all sorts of information about Wonder as well eventually), but of course people should feel free to contribute to and build the other spaces as they see fit and do we need some little elaboration as to what goes where, especially with Wonder/WebObjects since both are involved in many of technology topics Steven has listed under WebObjects? This might be a good idea. In general, we were hoping to approach it from a specific problem solution standpoint. That is, each article would answer a specific question such as how do I add Ajax partial page refreshes to my application. The articles we are hoping get put there will hopefully begin by explaining how it is possible to solve the task with WebObjects, and then show how much easier it is if you are willing to incorporate everything wonder brings to the table. So although wonder will be heavily referenced, the root of the article is in WebObjects. Perhaps if this all works out, we can create links from various wonder topics over to the articles rooted in the WebObjects section that mention them. . and should content be out here instead of wikipedia? (IMO, better have it here in objectstyle maintained by community than wikipedia) The consensus of everyone who discussed this was that the objectstyle site was better than the wikipedia site. I do not remember any objections whatsoever to the objectstyle site, so that's where we decided to nudge people to post things. ___ 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 [EMAIL PROTECTED]
Re: WebObjects documentation site
Andrew, I am sympathetic to your concerns. There has been some thought given to migrating the pages over, but there was also a large volume of concern expressed that the content be reorganized, so a straight programmatic migration doesn't seem to be what everyone wants. We expect most of the content to make its way over soon, but we'll probably be doing it a piece at a time to restructure a bit. Mark On Jul 2, 2007, at 4:07 PM, Andrew Lindesay wrote: Hello; Gee; that really is a shame because I've loaded quite a few pages into the Wikipedia books site. Can it be migrated over somehow? Given the volume of stuff there it may be worth just staying on the Wikipedia books site? cheers. . and should content be out here instead of wikipedia? (IMO, better have it here in objectstyle maintained by community than wikipedia) The consensus of everyone who discussed this was that the objectstyle site was better than the wikipedia site. I do not remember any objections whatsoever to the objectstyle site, so that's where we decided to nudge people to post things. ___ Andrew Lindesay technology : www.lindesay.co.nz business : www.silvereye.co.nz ___ 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 [EMAIL PROTECTED]
Re: [Wonder-disc] log4j version update?
Which bits of it would you like them to open up ? and why ? I would like every bit of it opened up, and the reason is that Apple moves like a glacier in response to fixing glaring issues that WebObjects has had in the past. If you adopted Webobjects prior to 5.2, you know what I'm talking about. The wonder community is far more responsive to issues, and if it had direct access to the source, it would be much easier to patch problems. Why *wouldn't* you want the source? Just about everything i want to tinker with is already open source, because the Wonder project either covers it or has replacements for the closed source bits i have any interest in. Yes, and if WO had been open sourced, you wouldn't need a separate framework. You wouldn't need replacements, because the fixes would already be in WebObjects. What about EOF ? Do i care it's closed source. Not at all: - it works perfectly (ok, there's a couple of bugs, but nothing to cry about) - it has a wonderful, elegant design, which despite many attempts has still not been matched by any other java framework (IMHO) - it's very stable - it's very scalable - it is supported and maintained by Apple - it's free EOF does not work perfectly. Outside of all the things wonder fixes for you, I would call it kind of a mess, especially if you follow the documentation Apple provides (although they have done better as of late). I agree it's better than most of it's competitors, but it certainly has its share of frustrations. That is just my opinion. I am glad EOF has been kinder to you. supported and maintained by Apple is another matter of opinion. In my opinion, it is not supported and maintained well. Many of the important fixes/workarounds/documentation attempts have come from outside of Apple. I see EOF as an extension of my database. We use MySQL - a great open source database. Have I ever tinkered with the source code of MySQL ? Of course not - i haven't even downloaded it, let alone looked at it. It works well and that enables me to build great apps. And that's all i care about. I also use MySQL, and I agree with you. It is great. I have never had the problems with MySQL that I have had with EOF. With great source code, you never need to tinker, and I never have. But, could it be that MySQL is great because the source code is available, and people who understand it and are more inclined to tinker have been able to fix problems they have had in the past? It's hard to know for sure, but there have been many, many frustrating instances for me in the past where having the code to EOF would have helped me tremendously, if not to fix a problem in EOF, at least to figure out what was going on. ___ 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 [EMAIL PROTECTED]
Re: Refreshing complete page from a header component
Can anyone comment on the benefits of returning context().page() vs. returning null for an action method? Returning context().page() seems to not work when using Wonder Ajax components, so I always return null there. Someone who worked at Apple once told me that returning context().page() was WAY more efficient. I took them at their word and started using it everywhere, but it's come to be one of those things that I kind of doubt makes that big of a difference. Does anyone know what the difference actually is, and why one might be better than the other? Mark On Jun 29, 2007, at 9:17 AM, Paul Lynch wrote: On 29 Jun 2007, at 12:31, Johan Henselmans wrote: I must be missing something: I have a header component, which contains the menubar, and sets the default language, by calling session.setlanguages() via a WOHyperlink. After that I want to return the current page. But a return this from within the Header WOComponent will only return the header. Any idea how to get the current page returned from within the header component? This is the structure: WOComponent-Page WOComponent-Header rest WOComponent-Footer Try: return context().page(); Paul ___ 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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Caret Notation
Hi all, I've always thought that using caret notation was a good idea when creating reuseable components, but it only seems to work for me about half the time, so I'm not sure I fully understand it. I have a component that has a textfield whose default binding should be inherited from it's parent component bindings: wo:textfield value = $date id = $id size=~format.length() dateformat = $format default=^default/ This textfield is embedded within a component named TextFieldCalendar. Here's my usage of TextFieldCalendar in another component: wo:TextFieldCalendar date = $maxBidClosingDate default = Bid Closing Before/ When I run the application, I get the following exception: Jun 29 10:44:50 LDC[11001] (ERXNSLogLog4jBridge.java:41) WARN NSLog - er.extensions.ERXDirectActionRequestHandler: Exception while handling action named advancedSearch on action class LDC :com.webobjects.foundation.NSKeyValueCoding $UnknownKeyException: [TextFieldCalendar name: TextFieldCalendar subcomponents: null takeValueForKey()]: attempt to assign value to unknown key: 'default'. This WOComponent does not have an instance variable of the name default or _default, nor a method of the name setDefault or _setDefault [2007-06-29 10:44:50 EDT] WorkerThread10 com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException: [TextFieldCalendar name: TextFieldCalendar subcomponents: null takeValueForKey()]: attempt to assign value to unknown key: 'default'. This WOComponent does not have an instance variable of the name default or _default, nor a method of the name setDefault or _setDefault at com.webobjects.appserver.WOComponent.handleTakeValueForUnboundKey (WOComponent.java:1580) at com.webobjects.foundation.NSKeyValueCoding $Utility.handleTakeValueForUnboundKey(NSKeyValueCoding.java:568) at com.webobjects.foundation.NSKeyValueCoding $_KeyBinding.setValueInObject(NSKeyValueCoding.java:925) at com.webobjects.foundation.NSKeyValueCoding $DefaultImplementation.takeValueForKey(NSKeyValueCoding.java:1293) at com.webobjects.appserver.WOComponent.takeValueForKey (WOComponent.java:1550) ... I thought that the point of using caret notation was that you didn't have to declare a local variable called default in the reuseable component. Am I off track here? Has anyone else noticed this behavior? Thanks, Mark ___ 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 [EMAIL PROTECTED]
Re: Caret Notation
So caret notation only works if you're not synchronizing bindings? On Jun 29, 2007, at 10:54 AM, Jean-François Veillette wrote: The component TextFieldCalendar should not synchronize it's bindings. - jfv Le 07-06-29 à 10:50, Steven Mark McCraw a écrit : Hi all, I've always thought that using caret notation was a good idea when creating reuseable components, but it only seems to work for me about half the time, so I'm not sure I fully understand it. I have a component that has a textfield whose default binding should be inherited from it's parent component bindings: wo:textfield value = $date id = $id size=~format.length() dateformat = $format default=^default/ This textfield is embedded within a component named TextFieldCalendar. Here's my usage of TextFieldCalendar in another component: wo:TextFieldCalendar date = $maxBidClosingDate default = Bid Closing Before/ When I run the application, I get the following exception: Jun 29 10:44:50 LDC[11001] (ERXNSLogLog4jBridge.java:41) WARN NSLog - er.extensions.ERXDirectActionRequestHandler: Exception while handling action named advancedSearch on action class LDC :com.webobjects.foundation.NSKeyValueCoding $UnknownKeyException: [TextFieldCalendar name: TextFieldCalendar subcomponents: null takeValueForKey()]: attempt to assign value to unknown key: 'default'. This WOComponent does not have an instance variable of the name default or _default, nor a method of the name setDefault or _setDefault [2007-06-29 10:44:50 EDT] WorkerThread10 com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException: [TextFieldCalendar name: TextFieldCalendar subcomponents: null takeValueForKey()]: attempt to assign value to unknown key: 'default'. This WOComponent does not have an instance variable of the name default or _default, nor a method of the name setDefault or _setDefault at com.webobjects.appserver.WOComponent.handleTakeValueForUnboundKey (WOComponent.java:1580) at com.webobjects.foundation.NSKeyValueCoding $Utility.handleTakeValueForUnboundKey(NSKeyValueCoding.java:568) at com.webobjects.foundation.NSKeyValueCoding $_KeyBinding.setValueInObject(NSKeyValueCoding.java:925) at com.webobjects.foundation.NSKeyValueCoding $DefaultImplementation.takeValueForKey(NSKeyValueCoding.java:1293) at com.webobjects.appserver.WOComponent.takeValueForKey (WOComponent.java:1550) ... I thought that the point of using caret notation was that you didn't have to declare a local variable called default in the reuseable component. Am I off track here? Has anyone else noticed this behavior? Thanks, Mark ___ 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/ jean_francois_veillette%40yahoo.ca This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: [Wonder-disc] log4j version update?
I am not sure what happening here is fair anyway. You guys at wonder are doing the job of an open source community, giving Apple the tools it works with, and what is Apple doing in counterpart? Nothing! Or very little. WO does not evolve, or so slowly. Apple does not even maintain the tools. Apple does not open source WO, creating a lot of problems for you and the WO community (you have hard time writing patches, and WO developpers have difficulties selling their products when there are open sources alternatives). In my opinion, this is not a fair deal. In a ideal world, Apple would either open source WO or actively develop it, and those who develop wonder and WOLips ought to be rewarded in some way, allowing them perhaps to devote more time to it. I don't understand that you seem to be happy with the current situation. But I am surely not aware of everything, and I don't know what WO 5.4 brings us. I don't know that I am happy with the situation, but I accept it for what it is. I am certainly happier now than I was before WWDC. Apple will never open source WO, so I never think about that. I just try to make WO better for me and hopefully better for others as well as a result of making it better for me. My other option is to go do VB.Net or Ruby on Rails. I'd rather not. So I do this. ditto. I think has done a terrible job managing WebObjects for at least the last 5 years. Their support for the product sucks, and their business strategy for it makes no apparent sense. Their refusal to ever consider open sourcing it (in spite of how Steve Jobs rants about how he looves open source) makes me feel even more animosity about the platform. The wonder guys have pulled WO development out of the gutter for me for now, and to be honest, I spent about a year evaluating all kinds of J2EE alternatives after hours, and all of them seemed terrible to me (maybe just because I've always done WO, so I'm used to that way of thinking, but still). WO seems like the lesser of dozens of evils at this point. Plus, everyone who went to WWDC seems about to lose it in their gushing excitement for 5.4, so maybe Apple picked the ball back up. Fingers crossed. ___ 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 [EMAIL PROTECTED]
Re: Java Client : who is using it ?
Hi Florijan, A couple of people are spending about 30 minutes a day each to consolidate a documentation effort for WebObjects. Obviously, at this pace, it's going to be weeks or months before anything really significant materializes (especially if it just remains two of us working on it), but such are the realities of our lives. I don't know java client from a hole in the ground, so if it's up to me, nothing will get written, but if you want to write up some things about it, I'll be happy to add it to the wiki we're trying to get together. Thanks, Mark Hi Garry, Since you and a few more people are interested, I will make it. At the moment I am too busy to put much time into it, but that should change in a week or two. I have two questions still: 1. How and where to most effectively lobby for JC future with Apple, or at least for an answer??? There seems to be enough interest for it for some of us to work together in documenting this and exchanging info, techniques and code, but we NEED TO KNOW (hint to Apple people) is there any point in it? 2. To all WO users, not only JC, shall we make this effort a part of some big WO site? I must admit I am not sure what sort of consensus was reached on centralizing resources. Or do we start another standalone thing? If not, with whom should we coordinate this? Best regards, Florijan ___ 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 [EMAIL PROTECTED]
Re: [Wonder-disc] ERSelenium without ERExtensions
ERSelenium's idea is to facilitate a lot of common tasks that are usually solved manually to organize Selenium testing. Among these tasks are: - Automatic test suites generation from your folder structure. I am curious as to what you are doing for this. To me, Selenium tests are for functional testing and so have no relation at all to project structure. The reason for doing it this way (says the guy who's used ERSelenium a few times now) is that is a piece of cake to create test suites. There is no maintaining an external test suite. You just create a folder called Selenium (or whatever you configure the name to be) in the Properties folder of the project you want to test, and any folder you embed within it becomes a test suite when you run everything from a simple URL. You drop your selenium tests in child folders of the Selenium folder and you are done. It is ridiculously easy, as opposed to the whole chrome:// test suite thing, which I never got to work, although I did not spend much time trying because ERSelenium became available just as I began getting good and familiar with using Selenium. The up side to user ERSelenium test suites (besides how easy it is to create them) is that they run in any browser. All you have to do is point to the 'StartSeleniumTesting' direct action class in your application url, and away you go. I believe I read that if you use chrome:// as your URL, you are stuck with Firefox as a testing platform, because only Firefox supports that protocol. - Writing tests in the preferred format - wiki/html. Is that different from Selenese? The difference is that instead of using html tags to delimit things, you use pipe symbols, and it's a lot more readable (says me). Instead of tr tdtype/td tduserName/td tdchill2/td /tr tr tdtype/td tdpassword/td tdchill2/td /tr tr tdclickAndWait/td tdloginButton/td td/td /tr You have |type|userName|chill2| |type|password|chill2| |clickAndWait|loginButton|| But I believe you can use this format with or without ERSelenium. - Unified format of setup/tear down methods with appropriate error messages. I don't see the need for these. For me, the Selenium tests should be from the point of view of the user of the application. So any setup / tear down outside of loading the bootstrap data should be done through the UI and be part of the test. In some rare occasions (mimicking interactions from other systems), I do need some setup that is not possible from the UI. In that case, I create a direct action to do this and call it from the test in a new window. The direct action is only enabled during testing runs. I agree with you here. I've just been using direct actions. Not sure what ERSelenium brings to the table here or how to use it. ___ 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 [EMAIL PROTECTED]
Re: WOPopUpButton
Is your code in a framework, or in your application? If it is in a framework, chances are good that the code will not compile because it knows nothing about a class named Session, which is probably in your application project. There shouldn't be any need to cast session() here anyway. Mark On Jun 22, 2007, at 1:15 PM, SigurĂ°ur E. Vilhelmsson wrote: Sorry to stray back to the original topic :P but I'm getting an error in my java file. I used the code from David: public NSArray allCourseDescription() { EOEditingContext ec = ((Session)session ()).defaultEditingContext(); return EOUtilities.objectsForEntityNamed(ec, CourseDescription); } (I figured the extra space and s in allCourseDescription s() were a typo) However, now I get an error complaining that Session cannot be resolved to a type. Best regards, Sigurdur ___ 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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: creating tables on the fly with webobjects
Having a table with 10,000 is no big deal. That's what databases are for: to efficiently organize data. Are you familiar with indexing? If not, go do a little research in that direction to figure out how to make your queries fast. Having a table with 10,000 rows is far better than having 10,000 tables. You should be able do a complicated fetch on a properly indexed table with 10,000 rows literally within a blink of an eye. Mark On Jun 22, 2007, at 2:06 PM, .::welemski::. wrote: It's like this. I'm creating a webapplications for work groups. Each user that is registered in the database can have a table on their own. So each user can register a member or a user can register to be a member of that user.Each main user can have a domain of their own and each member can have a blog of their own.It would be nice to separate them because one my friend told me that it would be inefficient to have all of them on one table. Imagine a table with 1000 or 1 or more records that would be inefficient for them for fetching. He also added that it'll have impact on time in terms of fetching. But if it's really okay to have one table for all users then I might as well stick with WebObjects then. I think I'll try Chuck's and Jacky's solutions first. ___ 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 [EMAIL PROTECTED]
Re: Getting Started With WO site
Well, then, should those of us who want a centralized repository focus on the confluence wiki? I would be happy to volunteer a little time each day trying to organize the thing and bring content from the wiki book (and anywhere else I can get info with the author's permission) over to the confluence site if everybody is in agreement that this is the smart thing to do. On Jun 18, 2007, at 6:50 PM, Mike Schrag wrote: Yeah it seemed like it would be nicer going in, but once the content was in there it has been less than useful ... The one big benefit of it is that it's not going away any time soon, which can't necessarily be said of any place that might host a confluence for us. ms On Jun 18, 2007, at 6:45 PM, Chuck Hill wrote: I also am less than thrilled with the WikiBook: - the process of adding images is painful - I am not sure if anything else can be added - searching just the WO content is either not possible or not clear - the markup is limited - no one has control over the backups etc. I have used Confluence quite a bit and find that to be much better for documenting technical material. Chuck On Jun 14, 2007, at 9:22 AM, Steven Mark McCraw wrote: Agreed. How do we (and I guess by we I mean everybody on this list) come to an agreement on the one place that should be the definitive posting grounds? Honestly, I sometimes find navigating the wiki book less than ideal, but it's kind of a minor irritation that I can live with if it solves the problem of a central repository, and there's so much there already that it seems like the most logical place to me. Whatever it is, it should be publicly editable, I think, and it has to be searchable and individual articles must be linkable. Is anybody in disagreement that the wiki book is the best place ongoing to post information? If so, can we start an effort to shuttle information posted elsewhere into the wiki book if it is missing? If not, what are alternative suggestions for the central repository of information? Thanks, Mark On Jun 14, 2007, at 12:10 PM, Dana Kashubeck wrote: On 6/14/07 11:57 AM, Steven Mark McCraw wrote: My understanding is that the webobjects wiki book (http:// en.wikibooks.org/wiki/Programming:WebObjects) is trying to become the central point of documentation for WebObjects that people post to. There's already a ton of info there, but we all know it could use a ton more. At WOWODC, when the experts panel was asked what could be done to help with project wonder, this is what they came back with immediately: We need people writing documentation, and this is the place to put it. Even if it's bad, there are so many people watching it that bad info will get edited out quickly. I think there's a danger in having TOO many informational sites. If everybody decides to wing it because they get on a high at a developer's conference regarding being able to document stuff to widen the movement, I think we will end up with dozens of blogs, half finished tutorials, etc. There's a reason there isn't much documentation on Wonder and WebObjects: writing good documentation is HARD and time consuming, and not a very glamorous task. So if you have 10 spare hours to write a decent article on a very specific issue, I think everybody would be better served if that went to the wikibook. That way, everybody can always point to one resource as definitive. I don't mean to be preachy about it or rain on anybody's parade that is putting up yet another site about WebObjects. What I just wrote might sound snappy or mean, but I don't mean it that way. I'm just trying to advocate a central repository for everything so people don't have to go here and there to get various pieces of the overall puzzle. Maybe if you start a site, you could also make sure that all of the contents of that site are also posted in the wiki book in the sensible place? Thoughts? I was thinking the same thing. Last year there were some really great efforts to put together the site for WebObjects information. I think it was this one: http:// wiki.objectstyle.org/confluence/display/WOCOM/WOCOM So there's that wiki, the wiki book, www.wocommunity.org, etc., etc. I completely agree that there is a huge need for documentation and resources and it is important for the community to put these things together. But right now everything just seems *so* scattered! Can those who have been generous enough with their time please post their content on one of the already existing sites? -- - Dana Kashubeck Systems Manager Riemer Reporting Service Inc. http://www.riemer.com Phone: 440-835-2477 x. 125 Fax: 440-835-4594 - dana.kashubeck.vcf ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list
Re: News from Webobjecs sessions
When Apple first posted the sessions for WWDC, it looked like there would be absolutely nothing at all about WebObjects at the developers conference (I was under the impression that this was the major impetus for WOWODC). So after WOWODC, I opted to skip WWDC and head back home. I am now kicking myself since apparently there's more news regarding WebObjects this year than at any developer's conference in the past. Of course, I'm merely speculating since any non-attendees are banned by the iron hand of Apple's NDA from knowing what all this cheery banter is about :) On Jun 15, 2007, at 1:48 PM, Janine Sisk wrote: Hmm, I think I can only go so far as A+ - I guess I am just not as exuberant as Mark and Pierre. Call it understated happiness. :) janine ___ 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 [EMAIL PROTECTED]
Re: Getting Started With WO site
Hey, thanks for doing that. I think it looks snazzy. WebObjects today is all about supportive community, from my POV, and I'm glad to be part of it. I'm glad to see so many links on the page pointing to the wiki book, because I think that's turning into the central repository for documentation. This might actually work against the goal, but what do you think about having a page where all the people on the lists that use WebObjects can go and list themselves and their organization as WebObjects users? I think one of the scary things about adopting WebObjects, is either that nobody has heard of it or they think it is a dead, has-been technology. It might be nice to see a bunch of people saying hey, I use WebObjects! It would also be useful just to see demographic info on what kinds of companies are using the technology. Mark On Jun 14, 2007, at 2:29 AM, David LeBer wrote: Hey all, For those of you who are not attending WWDC, there has been a lively discussion about many things WO. Motivated by this I whipped together a WO Getting Started page http:// gettingstartedwithwo.codeferous.com/ and I'd like to get your feedback. This is just a baby step, but please let me know if you think I'm heading in the right direction. This the first of what I hope will be a trio of sites: I would like to create a general WO news blog (with multiple core contributers) so there is a central clearing house for news of interest to the WO community (new features in Wonder or WOLips, announcements from Apple, significant additions to the wikkibook, good blog posts, etc). I would also like to create a tutorial blog where short clear graphical task-oriented tutorials could be posted - I have some ideas of how I'd want these tutorials to be presented, but I still have to work out the style guidelines (I'm thinking: short on text, long on screenshots or maybe screencasts). I approach this with some trepidation - because someone seems to try and do something like this once a year - but my goal is to present unified (a dare I say) inviting front to new developers to the WebObjects platform. We have a ton of outstanding material in the various wikis and lists, and I have no interest in replacing that, but I'd like to give new users a way to find and make sense of what is there. Again, feedback (and offers of assistance) is welcome and appreciated. -- ;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 -- 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/mark% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Getting Started With WO site
My understanding is that the webobjects wiki book (http:// en.wikibooks.org/wiki/Programming:WebObjects) is trying to become the central point of documentation for WebObjects that people post to. There's already a ton of info there, but we all know it could use a ton more. At WOWODC, when the experts panel was asked what could be done to help with project wonder, this is what they came back with immediately: We need people writing documentation, and this is the place to put it. Even if it's bad, there are so many people watching it that bad info will get edited out quickly. I think there's a danger in having TOO many informational sites. If everybody decides to wing it because they get on a high at a developer's conference regarding being able to document stuff to widen the movement, I think we will end up with dozens of blogs, half finished tutorials, etc. There's a reason there isn't much documentation on Wonder and WebObjects: writing good documentation is HARD and time consuming, and not a very glamorous task. So if you have 10 spare hours to write a decent article on a very specific issue, I think everybody would be better served if that went to the wikibook. That way, everybody can always point to one resource as definitive. I don't mean to be preachy about it or rain on anybody's parade that is putting up yet another site about WebObjects. What I just wrote might sound snappy or mean, but I don't mean it that way. I'm just trying to advocate a central repository for everything so people don't have to go here and there to get various pieces of the overall puzzle. Maybe if you start a site, you could also make sure that all of the contents of that site are also posted in the wiki book in the sensible place? Thoughts? On Jun 14, 2007, at 11:40 AM, Janine Sisk wrote: I have been thinking sort of along the same lines. I have received several requests this week to put my tutorial up where other people can edit it, but due to some bad experiences in the past (not with anyone here) I get hives just thinking about allowing open editing. So my thought was to set up a blog specifically for my tutorial, where people could post comments, point out mistakes and suggest future topics. This would also allow me to announce updates to all interested parties without spamming everyone on these lists. I've taken the opposite approach as David on tutorials - Mine is long on words and code, with no screenshots at all. That's partly due to time constraints and I might eventually put some in, but I think there is room for both styles. Some people are verbal learners, others are visual. I think David's idea is a great one, and I hope this can become the central repository of links to WO-related content. Things are a little confusing right how - people talk about the wiki and you always have to ask which one? That probably won't change, but having one place to send people for links to everything else would be very helpful. janine PS some people have asked me where to find my tutorial, so here's a shameless plug. The downloads are linked from http:// wiki.objectstyle.org/confluence/display/WOCOM/WO+Resources+and+Ideas. On Jun 13, 2007, at 11:29 PM, David LeBer wrote: Hey all, For those of you who are not attending WWDC, there has been a lively discussion about many things WO. Motivated by this I whipped together a WO Getting Started page http:// gettingstartedwithwo.codeferous.com/ and I'd like to get your feedback. This is just a baby step, but please let me know if you think I'm heading in the right direction. This the first of what I hope will be a trio of sites: I would like to create a general WO news blog (with multiple core contributers) so there is a central clearing house for news of interest to the WO community (new features in Wonder or WOLips, announcements from Apple, significant additions to the wikkibook, good blog posts, etc). I would also like to create a tutorial blog where short clear graphical task-oriented tutorials could be posted - I have some ideas of how I'd want these tutorials to be presented, but I still have to work out the style guidelines (I'm thinking: short on text, long on screenshots or maybe screencasts). I approach this with some trepidation - because someone seems to try and do something like this once a year - but my goal is to present unified (a dare I say) inviting front to new developers to the WebObjects platform. We have a ton of outstanding material in the various wikis and lists, and I have no interest in replacing that, but I'd like to give new users a way to find and make sense of what is there. Again, feedback (and offers of assistance) is welcome and appreciated. -- ;david -- David LeBer Codeferous Software 'co-def-er-ous' adj. Literally 'code-bearing' site: http://codeferous.com blog:
Re: Getting Started With WO site
Agreed. How do we (and I guess by we I mean everybody on this list) come to an agreement on the one place that should be the definitive posting grounds? Honestly, I sometimes find navigating the wiki book less than ideal, but it's kind of a minor irritation that I can live with if it solves the problem of a central repository, and there's so much there already that it seems like the most logical place to me. Whatever it is, it should be publicly editable, I think, and it has to be searchable and individual articles must be linkable. Is anybody in disagreement that the wiki book is the best place ongoing to post information? If so, can we start an effort to shuttle information posted elsewhere into the wiki book if it is missing? If not, what are alternative suggestions for the central repository of information? Thanks, Mark On Jun 14, 2007, at 12:10 PM, Dana Kashubeck wrote: On 6/14/07 11:57 AM, Steven Mark McCraw wrote: My understanding is that the webobjects wiki book (http:// en.wikibooks.org/wiki/Programming:WebObjects) is trying to become the central point of documentation for WebObjects that people post to. There's already a ton of info there, but we all know it could use a ton more. At WOWODC, when the experts panel was asked what could be done to help with project wonder, this is what they came back with immediately: We need people writing documentation, and this is the place to put it. Even if it's bad, there are so many people watching it that bad info will get edited out quickly. I think there's a danger in having TOO many informational sites. If everybody decides to wing it because they get on a high at a developer's conference regarding being able to document stuff to widen the movement, I think we will end up with dozens of blogs, half finished tutorials, etc. There's a reason there isn't much documentation on Wonder and WebObjects: writing good documentation is HARD and time consuming, and not a very glamorous task. So if you have 10 spare hours to write a decent article on a very specific issue, I think everybody would be better served if that went to the wikibook. That way, everybody can always point to one resource as definitive. I don't mean to be preachy about it or rain on anybody's parade that is putting up yet another site about WebObjects. What I just wrote might sound snappy or mean, but I don't mean it that way. I'm just trying to advocate a central repository for everything so people don't have to go here and there to get various pieces of the overall puzzle. Maybe if you start a site, you could also make sure that all of the contents of that site are also posted in the wiki book in the sensible place? Thoughts? I was thinking the same thing. Last year there were some really great efforts to put together the site for WebObjects information. I think it was this one: http://wiki.objectstyle.org/ confluence/display/WOCOM/WOCOM So there's that wiki, the wiki book, www.wocommunity.org, etc., etc. I completely agree that there is a huge need for documentation and resources and it is important for the community to put these things together. But right now everything just seems *so* scattered! Can those who have been generous enough with their time please post their content on one of the already existing sites? -- - Dana Kashubeck Systems Manager Riemer Reporting Service Inc. http://www.riemer.com Phone: 440-835-2477 x. 125 Fax: 440-835-4594 - dana.kashubeck.vcf ___ 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 [EMAIL PROTECTED]
Re: Getting Started With WO site
Janine, I think you make a good point. The last thing I want to do is discourage participation. Maybe people can just be on the lookout for useful content on these third party smaller sites, and can ask the author for permission to post in the wikibook (or whatever). Also, maybe the third party site authors can be aware that they will get more eyes reading their material if they post in the central repository as well, and maybe even link back and forth (i.e., on the independent site in the header of the article, put a link to the effect of also published in the WO wiki book and in the wiki book a link at the top of the article that says originally published at http://www.mywosite.com;). Perhaps that will seem like a good compromise to people and further the goal of getting good documentation out there in an easy to find place. Of course, if people aren't into posting into the wiki, they just aren't into it. I think it would be ideal if they did, but I'm not looking down on them if they don't agree. Just wanted to plant the seed that it might benefit the community the most if everybody posted to a central place. It should always be approached in the manner of hey, you wrote a great article on this. Thanks! Most people go here to read about WebObjects stuff. Can we put your great article there? as opposed to hey, why are you doing all that work to set up a site for that when a better site already exists. Mark On Jun 14, 2007, at 12:19 PM, Janine Sisk wrote: I've been participating in open source projects for a long time, and I've seen many different approaches. In my experience, when people worry about having too many sources of information it ends up stifling participation. Each person who sets up their own site has reasons why they don't want to use the existing one(s). Whether or not the rest of the community would agree with their reasons really isn't important; what matters is that if they are discouraged from doing so, they typically don't contribute at all, or not nearly as much as they would have on their own site. I think it is better to let people set up various sites, make sure there is one central point where they can all be found, and let the situation shake itself out. Usually one (or a small number) of the sites will emerge as the most used and the others will fade away. The thing to avoid is having discouraged the person who would have set up that most used site so that it is never created at all. Note that I'm not suggesting that the site I proposed will become one of those; it's meant as a site for those who wish to participate in and;or follow the writing of my tutorial. It's not a documentation site per se and not one that everyone is going to want to go to. janine On Jun 14, 2007, at 8:57 AM, Steven Mark McCraw wrote: My understanding is that the webobjects wiki book (http:// en.wikibooks.org/wiki/Programming:WebObjects) is trying to become the central point of documentation for WebObjects that people post to. There's already a ton of info there, but we all know it could use a ton more. At WOWODC, when the experts panel was asked what could be done to help with project wonder, this is what they came back with immediately: We need people writing documentation, and this is the place to put it. Even if it's bad, there are so many people watching it that bad info will get edited out quickly. I think there's a danger in having TOO many informational sites. If everybody decides to wing it because they get on a high at a developer's conference regarding being able to document stuff to widen the movement, I think we will end up with dozens of blogs, half finished tutorials, etc. There's a reason there isn't much documentation on Wonder and WebObjects: writing good documentation is HARD and time consuming, and not a very glamorous task. So if you have 10 spare hours to write a decent article on a very specific issue, I think everybody would be better served if that went to the wikibook. That way, everybody can always point to one resource as definitive. I don't mean to be preachy about it or rain on anybody's parade that is putting up yet another site about WebObjects. What I just wrote might sound snappy or mean, but I don't mean it that way. I'm just trying to advocate a central repository for everything so people don't have to go here and there to get various pieces of the overall puzzle. Maybe if you start a site, you could also make sure that all of the contents of that site are also posted in the wiki book in the sensible place? Thoughts? On Jun 14, 2007, at 11:40 AM, Janine Sisk wrote: I have been thinking sort of along the same lines. I have received several requests this week to put my tutorial up where other people can edit it, but due to some bad experiences in the past (not with anyone here) I get
Re: Getting Started With WO site
David, I agree with all your points about the way the wiki looks/behaves. And I am approaching it from the POV of somebody who has been doing WO development for coming up on 10 years now (yikes! I'm getting old) and am just hungry for the new information (project Wonder stuff, etc.). So it might not work for newbies. There is a scary amount of info there. It's hard trying to weigh that against all the benefits of the wiki (everybody can post there, it's searchable, etc) and figure out the overall best approach. As long as there is good cross- linking, I suppose everybody wins. Thanks for the input. Mark On Jun 14, 2007, at 12:29 PM, David LeBer wrote: On 14-Jun-07, at 8:57 AM, Steven Mark McCraw wrote: My understanding is that the webobjects wiki book (http:// en.wikibooks.org/wiki/Programming:WebObjects) is trying to become the central point of documentation for WebObjects that people post to. There's already a ton of info there, but we all know it could use a ton more. At WOWODC, when the experts panel was asked what could be done to help with project wonder, this is what they came back with immediately: We need people writing documentation, and this is the place to put it. Even if it's bad, there are so many people watching it that bad info will get edited out quickly. I think there's a danger in having TOO many informational sites. If everybody decides to wing it because they get on a high at a developer's conference regarding being able to document stuff to widen the movement, I think we will end up with dozens of blogs, half finished tutorials, etc. There's a reason there isn't much documentation on Wonder and WebObjects: writing good documentation is HARD and time consuming, and not a very glamorous task. So if you have 10 spare hours to write a decent article on a very specific issue, I think everybody would be better served if that went to the wikibook. That way, everybody can always point to one resource as definitive. I don't mean to be preachy about it or rain on anybody's parade that is putting up yet another site about WebObjects. What I just wrote might sound snappy or mean, but I don't mean it that way. I'm just trying to advocate a central repository for everything so people don't have to go here and there to get various pieces of the overall puzzle. Maybe if you start a site, you could also make sure that all of the contents of that site are also posted in the wiki book in the sensible place? Thoughts? I hear you Steven, so let me be clear my intention is not to replicate or duplicate any of the contents in the wikibook. I agree that it should contain the sum of the real-world knowledge possessed by the community but it does have some failings when it comes to presenting and attractive front to new developers - and they are my focus. 1. It is butt ugly - not that that matters as far as the content is concerned, but compare that with the Rails landing page and we are at a serious disadvantage as far as the perception of new developers. 2. It doesn't support images or other rich media (if I'm wrong let me know). The tutorials I am thinking about are high on visual appeal. My philosophy is: If it looks easy, people will think it *is* easy and if it looks cool, people will think it *is* cool. 3. It can be intimidating to new developers to WO. Pointing a new developer at the wikibook is like pointing someone at Niagara Falls for a glass of water (I just made that up, you can use it if you want :-). So: 1. A news site that gathers details from the disparate sources and puts them in one place. ie: ERSlenium.framework just added to Project WONDER and WebObjects Wikibook enhanced with new ERSelenium.framwork getting started guide and WWDC WebObjects Birds of a Feather - flashback to the summer of love! etc. 2. A tutorial site that offers task-oriented tutorial snippets. WIth a focus on being well designed, attractive, inviting, and above all easily digestible. Obviously each will contain links to the more detailed documentation contained elsewhere. Ultimately my focus is to entice new developers to the platform, and realistically the only way to do that is with sites that compete with the other frameworks vying for this mind share (ie: Rails, Django, TurboGears, etc). -- ;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 -- 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/mark% 40bluecollarsoftware.com
Re: Getting Started With WO site
My only objection to a non-virtual book is how quickly things change. Chuck Hill's book on WebObjects is brilliant. It's the best book I've read on the subject by far. But many aspects of it are already out of date with respect to the best way to do things. For example, my company just muddled through over a week of development time to implement comprehensive localization for a client's site, following the information in PWO as an example. Then we learned at WOWODC that project wonder now has the exact functionality that we implemented, although probably done better because more people have worked on it longer. I haven't refactored our code to use it yet, but I'll bet we could have saved days if we had known about the project wonder code. This kind of thing happens all too often, and it would be nice if, embarking on a new undertaking, there were one place to go and feel very confident that you could get the best, up to date information on a subject. To me, that's better than googling something and then sifting through half a dozen sites or more of varying quality on the subject. But judging from all the email posts earlier today on the subject, that may be an impractical utopia. On Jun 14, 2007, at 2:10 PM, Michael Warner wrote: The amount of brain power in the WO community is staggering. This was confirmed when I attended the WOWODC session last Sunday and listened to the presenters. Yet, IMESHO, there is something bogus about asking others to write documentation for you (see post below). I HATE writing documentation and I am as guilty as the next person of not doing it. Nevertheless, the difficulties in one's initial approach to WO, Project Wonder, etc., and difficulties in understanding and learning how to apply its (their) most powerful features are its central weakness. And this weakness is in turn based on a problem that is endemic to Apple and WO -- the lack of the kind of documentation that clearly lays out the why, when and how of the WO way. Clearly written expository text can make practically all of WO and WO-related methods (including when and how to use them) accessible to almost anyone. The elegant design aspects of WO could similarly be revealed by way of thorough, extensive text. I argued a couple of years ago that a multiple volume non-virtual book would be the best way to go, because in taking on such a project, the authors would have to develop a comprehensive sense of how all the specific bits of information fit together. Moreover (perhaps I am too old school) there is a public-ness and permanence (of historical value) to a book, a concrete thing that one can point others to, as a authoritative and centralized source. Just imagine a 2-3 volume set sitting on the shelf of every Barnes and Noble. Most responses to my suggestion at that time were negative, mostly based on the idea the such a project was impractical, which it probably is. If I wanted to wax cynical, I would say that making WO available to a wider audience is not a good idea -- people who were not smart enough to 'just get it' (without documentation and examples) , or not stubborn enough to approach things through extensive trial and error (my approach), and who were unable to appreciate its brilliance and elegance, might start using it -- the secrets of the inner sanctum would be revealed widely and soon all sorts of bad things might follow. A more/less ? practical suggestion might be this -- require as part of professional practice/protocol, that anyone who is developing applications like WO or who is writing methods to enhance WO be required to pair with a professional technical writer who's job it is to writie documentation. It may well be that the developers themselves may not be the best people to write the docs -- besides, they won't do it anyway, as history has shown. Mike Warner, curmudgeon at large On Jun 14, 2007, at 8:57 AM, Steven Mark McCraw wrote: My understanding is that the webobjects wiki book (http:// en.wikibooks.org/wiki/Programming:WebObjects) is trying to become the central point of documentation for WebObjects that people post to. There's already a ton of info there, but we all know it could use a ton more. At WOWODC, when the experts panel was asked what could be done to help with project wonder, this is what they came back with immediately: We need people writing documentation, and this is the place to put it. Even if it's bad, there are so many people watching it that bad info will get edited out quickly. ___ 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
Re: Nested Editing Contexts
Oh yes, and one more thing: You need to set up your system properties in the following way: er.extensions.ERXApplication.useEditingContextUnlocker=true er.extensions.ERXEC.defaultAutomaticLockUnlock=true er.extensions.ERXEC.useSharedEditingContext=false er.extensions.ERXEC.defaultCoalesceAutoLocks=true The last one is optional, I think, but I don't have a good enough grasp of what that last one is about to be able to explain it here. I saw it recommended in a posting once, and using it has done me no harm. I think that's it. List, is there anything else I'm missing? Mark On May 31, 2007, at 10:04 AM, Mike Schrag wrote: The only place where there are MAYBE some pitfalls (and this is just theoretical because I haven't done much testing of this case) is passing EO's between threads. I instead pass GID's, or use ERXEOControlUtilities.convertGIDtoEO/convertEOtoGID if I have dictionaries or arrays of them. ms On May 31, 2007, at 10:00 AM, Steven Mark McCraw wrote: Hey Ted, That's how I've been doing it for a bit now, and so far, so good! It certainly doesn't HURT to lock and unlock editing contexts created through ERXEC, but the authors of that whole business have done a great job in making it just as easy to use (locking-wise) as the default editing context, so there doesn't appear to be a need to. If you're already tightly integrated with Project Wonder, it shouldn't be too hard to make the changeover (just kind of tedious as you go through and find all the places that you need to retrieve local instances for relationships). Good luck! Mark On May 31, 2007, at 3:15 AM, Ted Archibald wrote: So, if I use ERXEC is there anything else I have to concern myself about? Is all the locking taken care of that I need to worry about? IOW, I can just go into my code and any instances I have of a defaultEC for creating and inserting objects I can simply use ERXEC keeping in mind that I need to retrieve local instances of other objects if need be. On 5/30/07, Steven Mark McCraw [EMAIL PROTECTED] wrote: Hi Ted, ... So, at the page level, I create a peer ec: EOEditingContext _peerEC = ERXEC.newEditingContext(); and then use it to create the new objects: MyEO eo = (MyEO)EOUtilities.createAndInsertInstance(_peerEC, MyEO); There are plenty of gotchas to be aware of here, mainly that if you are relating your newly created objects to objects that are contained in another editing context, you have to first bring those other options into the peer: OtherEO oeo = (OtherEO)EOUtilities.localInstanceOfObject(_peerEC, oeo); (or use EOUtilities.localInstancesOfObjects(EOEditingContext, NSArray to do a whole set at once). Hope this helps. Getting past these issues was a bitter struggle for me, and I wasn't even aware of all of the various problems (like having to have an EO in and editing context before doing ANYTHING to it) for several years. Trust me, better to start off following the rules people have figured out from experience than to have to go back later and refactor tons of code to fit those rules. Mark ___ 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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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/mschrag% 40mdimension.com This email sent to [EMAIL PROTECTED] ___ 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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Nested Editing Contexts
Hey Ted, That's how I've been doing it for a bit now, and so far, so good! It certainly doesn't HURT to lock and unlock editing contexts created through ERXEC, but the authors of that whole business have done a great job in making it just as easy to use (locking-wise) as the default editing context, so there doesn't appear to be a need to. If you're already tightly integrated with Project Wonder, it shouldn't be too hard to make the changeover (just kind of tedious as you go through and find all the places that you need to retrieve local instances for relationships). Good luck! Mark On May 31, 2007, at 3:15 AM, Ted Archibald wrote: So, if I use ERXEC is there anything else I have to concern myself about? Is all the locking taken care of that I need to worry about? IOW, I can just go into my code and any instances I have of a defaultEC for creating and inserting objects I can simply use ERXEC keeping in mind that I need to retrieve local instances of other objects if need be. On 5/30/07, Steven Mark McCraw [EMAIL PROTECTED] wrote: Hi Ted, ... So, at the page level, I create a peer ec: EOEditingContext _peerEC = ERXEC.newEditingContext(); and then use it to create the new objects: MyEO eo = (MyEO)EOUtilities.createAndInsertInstance(_peerEC, MyEO); There are plenty of gotchas to be aware of here, mainly that if you are relating your newly created objects to objects that are contained in another editing context, you have to first bring those other options into the peer: OtherEO oeo = (OtherEO)EOUtilities.localInstanceOfObject(_peerEC, oeo); (or use EOUtilities.localInstancesOfObjects(EOEditingContext, NSArray to do a whole set at once). Hope this helps. Getting past these issues was a bitter struggle for me, and I wasn't even aware of all of the various problems (like having to have an EO in and editing context before doing ANYTHING to it) for several years. Trust me, better to start off following the rules people have figured out from experience than to have to go back later and refactor tons of code to fit those rules. Mark ___ 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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: InsertObject
I personally stay away from using nested editing contexts, because I have been lost days of development a couple of times now by the state of the database context being mangled inexplicably when using a nested editing context. However, the exact same code works fine whenever I use a peer editing context rather than a nested editing context. No one posting to the list seems to have had these types of problems, however, so it might be specific to something else I was doing, but there is definitely some set of circumstances under which nested editing contexts do not work as advertised (and in a very frustrating, misleading way). At any rate, if you don't need any of the functionality you get from a nested editing context, I would avoid it and just create new (peer) editing contexts as needed. On May 30, 2007, at 11:56 AM, Guido Neitzer wrote: On 30.05.2007, at 09:49, Mark Morris wrote: I might have missed something, but for his case I'm not sure he needs anything more than the default editing context, and since he's new to some of the concepts, that might be easier. This is never really easier because it is s simple to screw up the default editing context and then you can't save anymore and you don't know why because errors happen in completely unrelated parts of the object graph. Just get used to different editing contexts. It makes your life so much easier! Applications that use only the defaultEditingContext scare me. cug ___ 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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Nested Editing Contexts
I definitely don't want to strike up a semantic argument on a list, but just to clarify: I think it's weak due to documentation and implementation. I can fully appreciate the complexity of the problem set EOF is solving. Tracking state is a bear, and I can appreciate the necessity of having to constrain programming language rules for a particular set of objects in an unintuitive way. But if the framework is such that failure to comply to those rules leads to untraceable, mysterious, unexpected behavior, I think the vendor should: A) Clearly document the issue from the outset of the product. Without an active third party community that enlightened these issues, I feel sure I would have never been aware of them, and probably would have switched development platforms in frustration by now. B) Programmatically constrain programmers to follow those rules. Since changing the state of an object is so catastrophic if the object is not in the pool that enables it to be tracked, why not throw an exception when that condition is encountered, rather than just letting the programmer proceed and wander into the terrible limbo of a hosed database context and all sorts of strange, untraceable and difficult to reproduce behavior? I think either one of those things would have saved lots of grief over the years for developers. I know it would have for me. At any rate, it's just my opinion, and it's so irrelevant anyway that I almost deleted this email without sending it to the list, but my fragile ego prevailed. I promise this will be the last one :) Mark On May 30, 2007, at 3:21 PM, Mike Schrag wrote: You have stumbled upon what I believe to be one of the biggest weaknesses in EOF, and the solutions are (again, in my opinion) terrible. I don't really see this as a big weakness of EOF ... It has to be able to track changes, and without an editing context, it's not in a transaction, and therefore you can't do it. You can usually get away with this if you're setting non-relationship attributes, but especially when it comes to relationships to other objects, this just can't fly. I put my constructor eogenerator templates up on the wikibook page months ago -- it autogenerates YourEntity.createYourEntity (...) with the attributes based on all required attributes and all required relationships. This gives you essentially exactly what you would expect a constructor to have, but more like a factory sort of pattern than a traditional constructor. 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/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Nested Editing Contexts
Cough. Cough. http://developer.apple.com/documentation/WebObjects/ Enterprise_Objects/EnterpriseObjects/chapter_3_section_13.html#// apple_ref/doc/uid/TP30001011-DontLinkChapterID_8-TPXREF146 And I quote, Note that immediately after the enterprise object is created, it is inserted into an editing context. As a cardinal rule, all enterprise objects reside in an editing context. This is necessary in order for enterprise objects to send and receive the notifications necessary for change tracking and other mechanisms within Enterprise Objects. So, for every enterprise object you create, you must immediately insert it into an editing context. http://developer.apple.com/documentation/WebObjects/ Enterprise_Objects/BusinessLogic/chapter_4_section_3.html#// apple_ref/doc/uid/TP30001011-DontLinkChapterID_3-TPXREF140 You may wonder why itâs not recommended to initialize an enterprise objectâs values in an objectâs constructor. An enterprise objectâs constructor represents the earliest state in the life of a particular object. The state of an enterprise object at the point of construction is not complete; the object is not fully initialized. It may not yet have been inserted into an editing context and it might not even have been assigned a global ID. You donât ever want to manipulate an enterprise object that isnât in an editing context or that doesnât have a global ID. I've seen that document as well, but I noticed the date on it was the latter half of 2005. I read all of the documentation Apple had regarding WebObjects back in 2000, and I even managed to get my hands on the training manuals for the courses they used to offer on WebObjects, and I don't ever recall seeing anything like that in any of the material. Of course, that is not to say it wasn't there. I wasn't specifically looking for it, so it's easy for me to imagine myself zipping over those short paragraphs without them making a big enough impression for me to remember. It is entirely possible that something like this was available from Apple very early on and I missed it. Even so, the language in even the recent document is pretty weak: it's not recommended to initialize an enterprise object's values in an object's constructor implies some violation of best practices or perhaps style, but certainly not if you do this your application will at some point break in frustrating ways that you cannot even imagine. But now I'm truly nitpicking about language, and I'm supposed to be a programmer, not an attorney. I'll quit publicly bitching at Apple on the list now. It's totally pointless anyway (except for that warm, happy feeling it gives me) ;) I have often wondered that. Now you have gone and provoked me. I will file a bug report. You _can_ do this yourself by adding this to your base EO class: public void willRead() { if (editingContext() == null) { throw new IllegalStateException(Access of instance of + entityName() + that has not been inserted into an EOEditingContext or whose EOEditingContext has been disposed); } super.willRead(); } That's good thinking. Also, I'll be interested to see what they say about it when you file that report. I think either one of those things would have saved lots of grief over the years for developers. I know it would have for me. At any rate, it's just my opinion, and it's so irrelevant anyway that I almost deleted this email without sending it to the list, but my fragile ego prevailed. I promise this will be the last one :) Not if you reply to this one! Grin. Ugh. You win this time ;) ___ 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 [EMAIL PROTECTED]
Re: Slow Batch Utility
Working directly at the JDBC level is really quick, particularly if you use connection pooling. Apache's dbcp library has worked great for me, and it's fairly easy to use (although configuration is a little bit of a pain). Here's how I use it: In your application, create a ConnectionPool (you can configure this any way you want): GenericObjectPool connectionPool = new GenericObjectPool(null); connectionPool.setMaxWait((long)5000); connectionPool.setWhenExhaustedAction (GenericObjectPool.WHEN_EXHAUSTED_GROW); connectionPool.setTimeBetweenEvictionRunsMillis(6); connectionPool.setMaxActive( 20); connectionPool.setMaxIdle( 10); connectionPool.setMinEvictableIdleTimeMillis( 6 ); ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(url, username, password); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory (connectionFactory,connectionPool,null,null,false,true); dataSource = new PoolingDataSource(connectionPool); To make sure all the connections close properly when the application exits, I override _terminateOrResetTimer() as well: public void _terminateOrResetTimer() { try { connectionPool.close(); } catch (Exception e) { } } System.exit(0); } Finally, create a convenience method to get a connection from the pool: public static Connection getConnection() { try { return dataSource.getConnection(); } catch (Exception e) { NSLog.out.appendln(ErrorStackTrace.toString(e)); } return null; } Now whenever you need to do things with the database, you just need to get a connection from the pool, create a statement with it, and then use that statement to execute your queries/updates: Connection connection = null; Statement statement = null; ResultSet result = null; try { connection = Application.getConnection(); Statement statement = connection.createStatement(); String sql = update something set something where something; ResultSet result = statement.executeQuery(sql); if (!result.first()) { sql = select max( + column + ) + column + from + table; result = statement.executeQuery(sql); result.first(); if (result.getInt(column) == 0) { next = startValue; } else { next = result.getInt(column) + 1; } sql = insert into something values(' + someValues + ', 0); statement.executeUpdate(sql); } } catch (SQLException e) { ... } finally { try { result.close(); statement.close(); // closing the connection frees it back to the pool connection.close(); } catch (SQLException f) { ... } } This code is mostly from memory, so no guarantees, but I believe the concepts are all right. I find it kind of frustrating and poorly designed that for every single thing you do throws a SQL exception that you either have to throw yourself or handle in some way. I can appreciate the reasoning behind it (database connection are probably more prone to fail than most things), but in my experience, failure rarely occurs and it makes coding a bit of a pain. You can write subclasses of Connection, Statement, and ResultSet that handle the exceptions in a consistent way if you like without having to catch exceptions all over the place. Hope this helps. Mark On May 25, 2007, at 9:59 AM, Guido Neitzer wrote: On 25.05.2007, at 01:22, Ted Archibald wrote: I have a webobjects accounts receivable application that I have a batch utility that changes certain fields everynight. I'm having issues with the speed of the batch utility and I suspect the slowness is due to having to access the full EO. Is there a way to change the value of a field in an EO WITHOUT having access to the full EO? I know you can do this through a stored procedure, but I would rather not do that. Is there a way to do this in WebObjects? In addition to what Kieran said: You can also use raw SQL. Look at
Re: Apple's Support of WebObjects
Chuck does, well, at least he has once ;) http://odeo.com/audio/372795/view Pretty Sweet. On May 4, 2007, at 7:57 PM, Miguel Arroz wrote: Hi! I didn't even knew that existed! :) Java world is usually so boring and dull that I simply don't care (the fact that WO runs on Java is an incident!)... do they talk often about WO in that podcast? Yours Miguel Arroz On 2007/05/05, at 00:46, Q wrote: On 05/05/2007, at 7:56 AM, Miguel Arroz wrote: Hi! On 2007/05/04, at 21:38, Kieran Kelleher wrote: I used Apple Tools for a few years and switched to WOLips/ Eclipse at the start of this year. Recently I had to work on an old XCode project and after 2 days, I was suicidal and I *had* to convert it to WOLips it was just too slow and painful to work in XCode and the pain is worse the bigger the project is. If you used both sets of tools for 3 months, you would not say that, especially when productivity and profit is at stake. The *majority* of Apple WO developers use Eclipse/WOLips, not XCode and that's public knowledge if you listen to certain podcasts. What podcasts? You mean you don't listen to the java posse? -- Seeya...Q Quinton Dolan - [EMAIL PROTECTED] Gold Coast, QLD, Australia Ph: +61 419 729 806 The world lies in the hands of evil And we pray it would last -- Apocalyptica, Life Burns! Miguel Arroz http://www.ipragma.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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Un-Worder-ized Ajax framework
Hi Ralph, I started out down the same path as yourself. Here is what I learned: 1) Don't try to get Wonder 3.0. You would think that this would be far more stable that the current build, but a recent build is the way to go (FAR more stable and complete than 3.0), especially with regard to AJAX stuff. 2) subclass ERXAjaxApplication instead of ERXApplication if you don't want to use other WOnder stuff 3) Consider using the frameworks. It's a few days of investment up front, but speaking as someone who was initially skeptical in adopting the frameworks in their entirety, I have to say, everything there seems really solid. I'm pretty heavily integrated now, and have no regrets about taking the plunge. Mark On Apr 26, 2007, at 11:57 AM, Ralph Scheuer wrote: Hello, we are currently evaluating the Ajax framework from Project WONDER. However, we do not intend to use anything else from those frameworks. Does anybody on this list have an un-WONDER-ized version of this framework or did anybody manage to get the version from WONDER 3.0 running without using ERExtensions (in particular without extending ERXSession and ERXApplication)? Thanks for any pointers. Ralph Scheuer ___ 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% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Get fetched raw row into an editing context
Hi Dana, I've had the exact same experience. I always just do a fetch. I find it's still very much worth it and cuts down a ton on memory and overhead if you're in the paradigm of showing overviews of a lot of items (especially if the hitlist is composed of attributes from several joined tables) to fetch raw rows and only instantiate as an EO if the user clicks to see detail, etc. One extra fetch (plus faults) doesn't seem to be that big of a deal performance-wise, and compared to grabbing everything as EOs, it's been a clear win for me. Mark On Apr 25, 2007, at 12:48 PM, Chuck Hill wrote: On Apr 25, 2007, at 8:54 AM, Dana Kashubeck wrote: Maybe there is an obvious answer, but if there is I'm missing it. I am fetching raw rows from the database at the adaptor level. I have no problem converting those raw rows into EOs, but I cannot for the life of me figure out how to get those EOs into an editing context without performing another fetch. Is there a way to get an editing context to register an EO that represents an existing row in the database fetched via the adaptor channel? There probably is a way to register the snapshot yourself, but it won't be overly easy. EOF has no way of knowing if a raw row has all the needed data so it always goes back to the database when a raw row is converted into an EO. I found this surprising too, but that is the way it is. Chuck -- 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 (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/mark% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Snapshot problems
Ok, I jumped the gun. When you asked if I had custom attributes, I thought you meant do you have instance variables within your custom classes of type 'NSMutable...'. After looking at page 43 of my shiny new PWO eBook, I see you were actually talking about custom attributes specified in the EOModel. The answer to that is, Good Lord, no. Here is what I meant (and thought you meant at first): public class CatalogItem extends _CatalogItem { /** * Temporarily holds the sale prices and quantities so we don't have to fetch them over * and over (since we don't want to use a relationship to saleItem, because * there may be many relationships to sale items which are for different sales * than the one we are concerned with.). */ public NSMutableDictionary saleInfo; public NSMutableArray sortedSaleQuantities; private boolean saleItemsFetched; public CatalogItem() { super(); saleInfo = null; saleItemsFetched = false; configurableKit = false; } ... Or was I right the first time, and the code I added above is problematic? Sorry for all the confusion / false hope. Mark On Apr 20, 2007, at 5:41 PM, Chuck Hill wrote: On Apr 20, 2007, at 2:28 PM, Steven Mark McCraw wrote: Another explanation occurred to me. Do you have any custom attributes in any of the objects? Are any of them mutable (e.g. NSMutableDictionary, NSMutableArray, a custom class that you wrote)? Yes, many of my classes have custom attributes. CatalogItem has an NSMutableDictionary and an NSMutableArray as custom attributes. DING DING DING! We have a winner! I believe some of my EOs also have attributes that are references to custom classes that I have written. Could this be problematic? Mutable attributes are death to EOF. That is your problem. Or at least one of them. If you really, really work at it you can probably get it to work, but it is really not worth the effort IMO. Make them immutable. Add cover methods to modify these values: make a mutable clone of the attribute, modify it, make an immutable clone and replace the attribute value. See page 43 of PWO if you have it. If you don't have it, can pretty much assure that you want it! Chuck Are you doing anything else, anywhere, that might be a departure from plain jane EOF? You may be doing something that appears innocent and unrelated which is actually hammering EOF. I am just trying to prod your memory. It's hard to know. What is an example of something you would consider not plain jane EOF? In InventoryItem, I'm overridding the 'set' methods for a couple of attributes that are likely to change frequently underneath EOF so that it can automatically handle Optimistic locking exceptions. An example of something like that is below. Yesterday after some of our email, I got worried that this may be doing something terrible with regards to EOF, and commented it all out so that everything was using the default implementation (and of course this was also the case when I commented out the entire body of each custom class), but it had no impact whatsoever on the test case that started all of this, so I felt more secure that it was ok to do this kind of thing. public void setShelfQuantity( Number newValue ) { Integer existingShelf = (Integer) shelfQuantity(); if ( shelfQuantity() != null availableQuantity() != null rawPrimaryKey() != null ) { int difference = newValue.intValue() - shelfQuantity ().intValue(); if ( difference = 0 ) { increaseShelfQuantityBy( difference ); increaseAvailableQuantityBy( difference ); } else { reduceAvailableQuantityBy( difference * -1 ); reduceShelfQuantityBy( difference * -1 ); } } else { super.setShelfQuantity( newValue ); setAvailableQuantity( newValue ); } if ( ( existingShelf == null || existingShelf.intValue() == 0 ) newValue != null newValue.intValue() 0 ) { Enumeration catalogEnum = catalogItems().objectEnumerator(); CatalogItem catalog = null; while ( catalogEnum.hasMoreElements() ) { catalog = (CatalogItem) catalogEnum.nextElement(); if ( catalog.futureRelease().intValue() == 1 ) { catalog.setFutureRelease( new Integer( 0 ) ); } } } } public void increaseShelfQuantityBy( int numberSold ) { super.setShelfQuantity( new Integer( shelfQuantity().intValue () + numberSold ) ); // try to save changes but check for conflicts try { successfulChangeSave(); } catch ( EOGeneralAdaptorException e ) { // conflict!! try again on the refaulted object super.setShelfQuantity( new Integer( shelfQuantity().intValue () + numberSold ) ); try { successfulChangeSave(); } catch ( EOGeneralAdaptorException f ) { NSLog.out.appendln( Multiple conflicts increasing shelf qty!: + shelf
Re: Snapshot problems - Solved, sort of
Are other people using nested editing contexts? Yes, in reasonably heavily used production applications. BUT the big difference that I see is that you seem to create on per session. I usually create one per function/page. This seemed like the way to go to me, too, at first. But then I read (see link below) that you couldn't reliably lock an editing context in a page's awake/sleep like in session, because those might not always get called with a one to one correlation (that is, you might somehow have two awake() invocations or two sleep() invocations in a row). Since attributes on EOs in that ec will be getting set when the form values are pulled, I didn't know how to lock correctly if I couldn't lock/unlock in awake/sleep, so I moved all that business to session, as the post suggested. from http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/ Using_EOF/Context_and_Database_Locking: In general you are better to lock EC's in the session (if you've got one) rather than the component and One thing to watch out for is that EC locking on the page's awake() and sleep() doesn't really work, because awake may be called more often than sleep. So how do you get around the locking issues at the page level? Do you just use the project wonder classes, which appear to lock everything for you? I finally found a workaround that works, taken from a post in like 2002. In Application's constructor, I call EODatabase.disableSnapshotRefCounting(); HACK! :-) Agreed :) But why does it work? If the application runs great without snapshot reference counting, it tells me that the problem lies in the way EODatabase is managing its snapshot dictionary. Specifically in this instance, it seems to be decrementing the count of things pointing to each entry prematurely, leading it to prematurely delete the dictionary entry. So what are the possible causes of EOF making this mistake (or what is it that I'm doing that prompts EOF to make this mistake, if you prefer ;))? I guess that's what this whole thread has been about. Here's the list of things I know about: Don't set EO properties in the EO constructor -- use awakeFromInsertion(...) or awakeFromFetch(...) instead : I've examined each and every EO constructor in all my frameworks at least 4 times now. Most either don't exist, or just call super(), and the rest (one or two) only call super() and set a couple of non-modeled local attributes. Don't do anything to an EO before inserting it into an editing context. Always insert EOs into ECs immediately. See rule #1: I made a comprehensive list of all my EO classes (about 90) and then searched all applications and frameworks for new X() where X is the name of each EO. There are no results for any of my EOs anymore, because they all use EOUtilities.createAndInsertInstance. There are actually one or two places that I use introspection to create new EOs ,but in each of those places, they get inserted immediately after creation. Actually, this is something I've never heard discussed. Does EOF play nice with introspection? Maybe that is my problem. I will rewrite that code next... Don't modify any EO properties in validateFor...(...) methods. Doing this in validateValueForKey(...) is ok as Chuck Hill noted in the list.: There is only one validateFor method in all of the frameworks and applications: public void validateForSave() throws NSValidation.ValidationException { super.validateForSave(); if ( supplier() == null ) { throw new NSValidation.ValidationException( All inventory items must have a supplier ); } } If over-riding awakeFromInsertion(...), remember to call ther superclass implementation. Same with awakeFromFetch(...): This was the easiest one to verify. Searched all EOs, and for sure they all call super.awake... Don't change the behavior of methods that EOF uses. For example, do not override to-many relationships to return a sorted list of the related objects. Make another method to do this.: Verified that this cannot happen by commenting out all overridden methods in every EO I have, recompiling, rerunning the problematic code, and getting the same behavior Don't use mutable classes (e.g. NSMutableArray, NSMutableDictionary, any other class that can change internal state after creation) as attributes. If you want this effect, use immutable classes and provide cover methods to replace the immutable instance with an updated instance. You and EOF will be much, much, much happier: Definitely not doing this Locking problems: I turned on DebugGroupMultithreading in NSLog, and nothing happened. If I explicity comment out the code which locks my ECs, I get warnings all over the place, so it looks like my code is working in that regard. Does anyone know of any other thing that causes EOF's snapshot counting to go screwy? You have
Re: Snapshot problems - Solved, sort of
Hi Lachlan, Thanks for responding. Interesting approach. If the only method available to getting the nested context from the session is always going to revert the changes on it, why not just do the following? public EOEditingContext getNestedEC() { return ERXEC.newEditingContext( defaultEditingContext() ); } That way (as Ken mentioned) if the context is not saved in the editing page using it then it's simply garbage collected. Good suggestion. I tried it, but ended up with the same problem. Also my understand is that ERXEC has automatic locking, so I'm not sure why you're attempting to lock/unlock in your session awake/ sleep methods. That may be overriding some normal behaviour. Or have you turned off it's automatic locking? My understanding regarding ERXEC is the same as yours, and even reading through the Project Wonder code, I get the strong impression that it should work everywhere. But if I comment out my locking code and add the following to my application constructor: NSLog.allowDebugLoggingForGroups (NSLog.DebugGroupEnterpriseObjects | NSLog.DebugGroupMultithreading); I get output everywhere that I am using an editing context without a lock. So I'm a little afraid to leave it that way. -Session.java Within my Edit page, I have an instance variable that I call _nestedEC which gets initialized by calling session.getAndRevertNestedEC(); I can create EOs, insert them into _nestedEC, save _nestedEC, save session.defaultEditingContext(), and everything is great. If I then immediately delete the newly saved and created EOs: _nestedEC.deleteObject(objectToDelete); _nestedEC.saveChanges(); ec.saveChanges(); Is this being done within the same edit page? i.e., there's some method to apply changes which displays the same page again and then there's an action that can be hit which allows the user to delete the objects? Yes, exactly. The main point of the edit page is to allow the user to create a catalog item in a store which represents a bundle of other items, but at a discounted price if they are bundled together. The overall catalog item gets created correctly, but the section of the page which allows you to add/remove bundled items is where the issue is. For some reason, adding is not a problem, and removing items when you first come into the page is not a problem, but if you add items (which reloads the page) and then delete items that you have just created, it might do fine on the first one or two that you create/delete, but somewhere along the way it will throw an exception that complains that it doesn't have a snapshot for the item you are deleting: java.lang.IllegalStateException: recordDeleteForObject: com.webobjects.eoaccess.EODatabaseContext [EMAIL PROTECTED] failed to find a snapshot for EO with Global ID:_EOIntegralKeyGlobalID[KitQuantity (java.lang.Integer)1234] that has been deleted from [EMAIL PROTECTED] Cannot delete an object that has not been fetched from the database Is it possible that because each edit page always receives the same nested context from the session rather than a unique instance for that page that the user has opened another edit window within the same session and thus blown away the nested ec's current state? I think that technique is problematic in either case. It is possible. I've never tried creating the nested EC at the page level because of information contained here: http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/Using_EOF/ Context_and_Database_Locking How/where do you lock nested editing contexts that you create at the component level? Furthermore, if I examine the state of the snapshots, I can see that they get in all kinds of terrible shape as I add/delete things in the nested EC and save changes. I should clarify one point. _nestedEC's snapshots of the objects seem fine, but the default editing context's snapshots just go to hell in no time if I don't use EODatabase.disableSnapshotRefCounting() in my application's constructor. Do you do this in your applications? No. Cool. Well, it certainly seems to be working correctly for a few people at least, so there must be something I'm doing that's throwing if off. I'll keep trying things that people suggest as long as the suggestions keep coming in... Mark ___ 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 [EMAIL PROTECTED]
Re: Snapshot problems - Solved, sort of
Hey Mike, Just looked up how to turn on auto-locking. Added the following to my properties file: er.extensions.ERXApplication.useEditingContextUnlocker=true er.extensions.ERXEC.defaultAutomaticLockUnlock=true er.extensions.ERXEC.useSharedEditingContext=false er.extensions.ERXEC.defaultCoalesceAutoLocks=true Now when I run with the prior suggestion of creating a new nested ec at the beginning of the page, I still have the original problem, but, as advertised, no complaints about locking. Mark On Apr 22, 2007, at 2:04 PM, Mike Schrag wrote: Sorry to say that, but than still something seems to be screwed up in your environment. I'm not saying that you're doing something wrong as I really don't know that, but I found that the Wonder (ERXEC) locking stuff and also nested editing contexts just work in about two dozen applications we are using with that. Only if he explicitly turned it on, though ... It sounds to me like he's not actually using auto-locking. 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/mark% 40bluecollarsoftware.com This email sent to [EMAIL PROTECTED] ___ 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 [EMAIL PROTECTED]
Re: Snapshot problems - Solved, sort of
And if you have not turned on automatic locking, it may be that the logging for missing locks you thought you had on is either not or or going someplace that you are not seeing. Try intentionally creating a regular EOEditingContext and doing a fetch with out locking. Do you get an warning message in the log? Chuck Yes, something to the effect of This is not a real exception, just an indication of the missing lock plus a stack trace. ___ 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 [EMAIL PROTECTED]
Re: Snapshot problems - Solved, sort of
cat /System/Library/Frameworks/JavaWebObjects.framework/Resources/ version.plist Comes back 5.3.3 for me: ?xml version=1.0 encoding=UTF-8? !DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http:// www.apple.com/DTDs/PropertyList-1.0.dtd plist version=1.0 dict keyBuildVersion/key string1/string keyCFBundleShortVersionString/key string5.3.3/string keyProjectName/key stringJavaWebObjects/string keySourceVersion/key string9550200/string /dict /plist I've ruled out a couple of more issues. I took out creating EOs through plain old java introspection (although I assume EOUtilities.createAndInsertInstance uses introspection to create an EO if it just has the string, and I'm still using that). Also, I ruled out that it is the way I'm doing locking with the nested editing context. I took everything out of session, turned on autolocking in Project Wonder, and created the nested editing context at the page level rather than at the session level. I don't do any explicit locking of anything anywhere, but PWO appears to be handling that perfectly. However, I'm still getting the exception, and in fact, I'm getting more of these warnings now before actually throwing the exception: DEBUG NSLog - decrementSnapshotCountForGlobalID: com.webobjects.eoaccess.EODatabase [EMAIL PROTECTED] -- is unable to decrement snapshot count for object with global ID _EOIntegralKeyGlobalID [KitQuantity (java.lang.Integer)1346] - count is already 0 or this snapshot doesn't exist This might just be a coincidence though. I'm interested in the possibility of peer editing contexts mentioned by Mike and Chuck rather than using nested editing contexts. That's going to be my next attempt. If the editing context is at the component level, there shouldn't be a problem if someone leaves the page with the EOs in the EC in a half-finished state. I can't think of any other issues. Are there any gotchas there I should be aware of? I'll post the results as soon as I know them... Mark ___ 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 [EMAIL PROTECTED]
Snapshot problems SOLVED, FOR REAL, NO JOKE
Holy crap, people! I finally got the stupid code to work without any hacks! Ok, I'm excited because it's finally working, but things still may be broken all over the place. I haven't tested extensively yet. The problem? NESTING THE EDITING CONTEXT. I'm not kidding. It was a matter of changing ERXEC.newEditingContext(session.defaultEditingContext()) to ERXEC.newEditingContext(); And if you're using Project Wonder's automatic locking, there are no problems (that I've found) with needing to lock. Heck, I imagine you could keep an editing context in session like I was doing earlier and lock and unlock in awake/sleep as long as it wasn't nested in the session's default ec (although I have not bothered to verify this yet). The more I think about it, why would you ever need to use a nested editing context instead of a component level peer editing context? I guess I just got the idea stuck in my head because some Apple document I read (http://developer.apple.com/documentation/ LegacyTechnologies/WebObjects/WebObjects_4.5/System/Documentation/ Developer/WebObjects/Topics/ProgrammingTopics.39.html) recommended doing it that way. Ok, I know this document is old, but it's the only document from Apple I could find on the subject. I should really know better by now than to trust Apple WebObjects documentation. Oh well, live and learn. Thanks everybody! Mark ___ 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 [EMAIL PROTECTED]
Re: Snapshot problems
Hi all, I think I've made some progress on the problem of my snapshots getting out of line when trying to delete a newly added EO. For a long time, I chased the notion that I was somehow, somewhere, violating one of the EOF Commandments (http://en.wikibooks.org/wiki/ Programming:WebObjects/EOF/Using_EOF/The_EOF_Commandments). I did exhaustive searching through all of my custom EO code, determined that I was not violating anything in any way, and then just to be sure, went through and commented out every overriding method in every Custom EO I had (even toString and the awakeFrom* methods, out of paranoia). Even with all of this, I still had the problem, so I concluded it must be something else. I turned up logging on everything I could think of, and started watching the logs as I went through the workflow, and soon I came to this: DEBUG er.eo.ERXGenericRecord - saveChanges: before save to child context [EMAIL PROTECTED], need to flush caches on objects in parent context [EMAIL PROTECTED]: Now, I am not sure what is going on here, and definitely do not want to start pointing the finger at the project wonder stuff, but suddenly this seems like a very good place to look. So I changed my EOGenerator templates so that nothing inherited from ERXGenericRecord anymore, and removed any references to ERXEC, but I still seem to get that same message in my output. So my questions are: A) Why are my EOs getting cast to ERXGenericRecord still, and how do I make that stop so that I can see if it is in fact the problem and B) Why is something flushing caches on the parent object when the child object saves? This certain SOUNDS like it could be what's screwing up my parent editing context's snapshot. Thanks, Mark ___ 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 [EMAIL PROTECTED]
Snapshot problems - Solved, sort of
Ok, so I turned off all the project wonder stuff (another 5 hours of work) and the thing keeps breaking. But I think I can rule out ERX* as the cause of the problem. I started looking way back on the list, and noticed that in early versions of WebObjects 5, tons of people (relatively speaking) where having the exact same problem I'm currently having. That is, when they were using nested editing contexts, they would often get messages and exceptions from EODatabase because of the (I think I've earned a rant here) poor, poor, pathetic job that EOF does of keeping track of the snapshots. I think that this has something to do with using nested editing contexts. I never once ran into the problem before I started using nested editing contexts (I was just creating EOs and not inserting them into an editing context, which worked fine), but after reading that this was one of the worst things I could do, changed all my code so that EOs immediately got inserted (there is now no instance of a EO constructor being called in my code. I use EOUtilities.createAndInsertInstance everywhere). Are other people on the list creating EOs without inserting them into an editing context? Are other people using nested editing contexts? If not, how do you keep things from getting stuck in the database half finished all over the place? Tons of local variables? And if so, is no one else seeing these kinds of ridiculous corrupted snapshot problems? I finally found a workaround that works, taken from a post in like 2002. In Application's constructor, I call EODatabase.disableSnapshotRefCounting(); Supposedly, this means that memory from every snapshot ever created of any object will just stick around in the database until the application dies (I say supposedly, because I can't find a shred of documentation from Apple that says exactly that, but posts from other people have implied as much. Am I starting to sound bitter?). And if that is the case, it sucks to do it. The only thing that sucks worse is an application that breaks randomly and unpredictably everywhere I use a nested editing context. Is there some workaround to the workaround? That is, is there some way to periodically tell EODatabase to clean itself up so that it doesn't waste so much memory? Are people just scheduling monitor to restart their applications periodically? Any thoughts? Mark On Apr 21, 2007, at 3:08 PM, Kieran Kelleher wrote: AFAIK Project Wonder patches in ERXGenericRecord as a default entity class name for EOGenericRecord. Check this property in your Properties file er.extensions.ERXEntityClassDescription.defaultClassName Look at method public void prepareEntityForRegistration(EOEntity eoentity) in ERXEntityClassDescription On Apr 21, 2007, at 2:18 PM, Steven Mark McCraw wrote: A) Why are my EOs getting cast to ERXGenericRecord still, and how do I make that stop so that I can see if it is in fact the problem ___ 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 [EMAIL PROTECTED]
Re: Snapshot problems - Solved, sort of
Hi Ken, Thanks for writing. If not, how do you keep things from getting stuck in the database half finished all over the place? Tons of local variables? I'm not sure why this would happen. If you destroy the child editing context without saving to the parent, you should not have anything half finished anywhere. I wasn't very clear here. What I meant to say was that I'm attempting to use nested editing context as a means of preventing people from setting a few attributes of an EO, not committing, going to another totally unrelated page, and committing the previous changes from before when they save. Nested editing contexts seem to be one means of accomplishing this. I'm having all kinds of difficulties with them, so I'm looking for other alternatives. One other alternative would be to define a dictionary or a bunch of local variables per page to bind to, and only copying those into an EO when you are ready to commit. However, this requires a lot of extra boring work, since you would have to bind to each local variable (instead of just binding to the EO's attributes) and then copy those over to the relevant EO's when you were ready to commit. Since the thing I've been doing for years (not inserting the object) has been getting so much bad press lately, and the suggested alternative (nested ECs) is causing me to lose tons of sleep, and the other alternative I can think of seems like a lot of boring work, I'm asking if there are other alternatives or at least if others are having the same experiences I am having with nested ECs. And if so, is no one else seeing these kinds of ridiculous corrupted snapshot problems? Honestly, I don't. Can you give us some examples of your usage of nested contexts and why you end up with half finished data? Ken As explained above, I don't end up with half finished data, but I do end up with corrupted snapshots in EODatabase which cause exceptions when I try to do fairly trivial things. Here is the setup... I have a nested editing context reference in session (nested in the session's default editing context): -Session.java protected EOEditingContext _nestedEC; protected boolean _lockedNested; public Session() { super(); _nestedEC = ERXEC.newEditingContext( defaultEditingContext() ); _lockedNested = false; } public EOEditingContext nestedEC() { return _nestedEC; } public EOEditingContext getAndRevertNestedEC() { _nestedEC.revert(); return _nestedEC; } public void awake() { super.awake(); _nestedEC.lock(); _lockedNested = true; } public void sleep() { try { if ( _lockedNested ) { try { _nestedEC.unlock(); } catch ( Exception e ) { NSLog.out.appendln( unlock without lock: + e ); } _lockedNested = false; } } catch ( Exception e ) { NSLog.out.appendln( ErrorStackTrace.toString( e ) ); } super.sleep(); } -Session.java Within my Edit page, I have an instance variable that I call _nestedEC which gets initialized by calling session.getAndRevertNestedEC(); I can create EOs, insert them into _nestedEC, save _nestedEC, save session.defaultEditingContext(), and everything is great. If I then immediately delete the newly saved and created EOs: _nestedEC.deleteObject(objectToDelete); _nestedEC.saveChanges(); ec.saveChanges(); I will eventually randomly get something that looks like this: java.lang.IllegalStateException: recordDeleteForObject: com.webobjects.eoaccess.EODatabaseContext [EMAIL PROTECTED] failed to find a snapshot for EO with Global ID:_EOIntegralKeyGlobalID[KitQuantity (java.lang.Integer)1234] that has been deleted from [EMAIL PROTECTED] Cannot delete an object that has not been fetched from the database Furthermore, if I examine the state of the snapshots, I can see that they get in all kinds of terrible shape as I add/delete things in the nested EC and save changes. I should clarify one point. _nestedEC's snapshots of the objects seem fine, but the default editing context's snapshots just go to hell in no time if I don't use EODatabase.disableSnapshotRefCounting() in my application's constructor. Do you do this in your applications? Thanks, Mark ___ 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 [EMAIL PROTECTED]
Re: Snapshot problems
Hi Mark, Now we are getting somewhere! I have removed the mostly irrelevant bits. Super! I am dying to get to the root of this. There was nothing in them at all last night when I tested. I went ahead and uncommented everything this morning, because it seemed to have no effect. The superclasses are just the generated classes from EOGenerator. The only unusual thing about them is that I had to change the template for the to-many relationships to make sure that they returned an empty array rather than null if no relationships had been set, RIght here. This is where the red lights flash and the sirens start whooping. This is also a symptom of the problem but it much closer to the problem. Until you fix this, EOF is not right and you are wasting time trying to fix a symptom of a deeper, underlying problem. Does this happen for both newly created objects and fetched existing objects? Just one of them? Does it happen for all EOs or just some of them? Usually this means that you have forgotten a call to super.awake... in awakeFromFetch or awakeFromInsertion. Are you using inheritance at all? Check all the way up the inheritance chain, even into frameworks. Ok, I have reverted to the original template that came with EOGenerator, I have regenerated all of my EOs, and recompiled. So far, I have not hit the NullPointerException difficulties that I used to have with the old template. As I recall, the previous issue applied to all objects that referenced a to-many relationship which had no foreign rows defined yet, whether the object was new or not. The only thing that I changed in the EOGenerator template (I used EOGJavaSource.eotemplate) was importing er.extensions.ERXGenericRecord and making everything subclass ERXGenericRecord. Could this be a mistake? Should I go back to subclassing EOGenericRecord? The only other reason that this would happen is if it failed to find a ClassDescription for the entity. It uses model information to determine what relationships to initialize. Right now, I suspect that this is your problem. Add your application as an omniscient observer to NSNotificationCenter and log out all notifications. That will probably show where the problem starts. ok, my application is now an omniscient observer, and holy cow, there is a lot of logging coming out. The relevant part seems to be at startup, and sure enough, for every table in the model, there is a line that looks like this: INFO NSLog - class com.webobjects.foundation.NSNotification (name=EOEntityLoadedNotification, object=EOEntity CatalogItem 2061482, userInfo={}) Then there is this line: INFO NSLog - class com.webobjects.foundation.NSNotification (name=ERXModelGroupAddedNotification, object=EOModelGroup ((CCGStore, file:/Library/Frameworks/ EclipseCCGStoreFramework.framework/Resources/CCGStore.eomodeld), (Karaoke, file:/Library/Frameworks/EclipseKaraokeMisc.framework/ Resources/Karaoke.eomodeld), (erprototypes, file:/Library/ Frameworks/ERPrototypes.framework/Resources/erprototypes.eomodeld), (CCGAuth, file:/Library/Frameworks/EclipseCicadaUtility.framework/ Resources/CCGAuth.eomodeld)), userInfo={}) Then, (again for every table in each of the EOModels I am loading) there is a line that looks like this: INFO NSLog - class com.webobjects.foundation.NSNotification (name=EOClassDescriptionNeededForEntityNameNotification, object=CatalogItem, userInfo={}) When I actually do things in the application, a ton more stuff comes out, but I'm not sure how much is relevant. Is there something else I should be looking for? What does EOClassDescriptionNeededForEntityNameNotification mean? Does this signify some kind of problem with my EOModel(s)? Now, before you do that, you might want to look at the model again. Are you sharing classes across entities (have multiple entities using the same class name)? Are some of the entities in another model that is not getting loaded? Are using inheritance with non-unqiue restricting qualifiers? Chuck I am not sharing classes across entities, and it appears all my models are getting loaded from all the included frameworks. I am not using inheritance anywhere. That is because you hid the earlier symptom of the real problem. Good to know. I'll be thrilled to find the real problem so that I can avoid it in the future. Thanks again for the help. ___ 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 [EMAIL PROTECTED]
Re: Snapshot problems
Have you tried creating a new KitQuantity and verifying that the to many relationships are non-null and instances of NSMutableArray? KitQuantity actually doesn't have any to-many relationships, just 2 to-one relationships (to CatalogItem and InventoryItem). However, I did print out the class of every to-many relationship of CatalogItem (both a new one and one that existed already) and they were always of type com.webobjects.eocontrol._EOCheapCopyMutableArray, so at least that problem isn't still haunting me/begging for a cheap workaround. It could very well have been the case that when I was having those problems, I was initializing something in a constructor somewhere or some other EOF Commandment violation. I only became aware of the EOF commandments a few months back, and I've been trying to revise all my code to conform to them. That is what has led me to all of this, but I have faith I will be better off in the end for it. It might be worth trying to sub-class EOGenericRecord to see if it makes any difference. I am not aware of any problems related to ERXGenericRecord, but it is a good test to make anyway. I started to roll this back to EOGenericRecord, but I've been leaning pretty heavily on some of ERXGenericRecord's methods (like primaryKey () and rawPrimaryKey()), and at this point it would probably take me an hour or two to switch everything out, recompile, and recheck. I'll put this on the last resort list for now and come back to it. No, that is normal. Try adding this to KitQuantity and create a new one: public EOClassDescription classDescription() { EOClassDescription description = super.classDescription(); NSLog.out.appendln(KitQuantity classDescription: + description); return description; } The output is below. It all looks correct. Just for the heck of it, I added this to CatalogItem and InventoryItem as well. KitQuantity classDescription: class er.extensions.ERXEntityClassDescription (entity name: KitQuantity, attributes: (quantity), to-one relationships: (catalogItem, inventoryItem), to-many relationships:()) CatalogItem classDescription: class er.extensions.ERXEntityClassDescription (entity name: CatalogItem, attributes: (electronicDelivery, keyDetailObject, searchSummary, isAvailable, weight, volume, sku, itemDescription, msrp, expirationDate, storefrontVisibility, visibleReviewCount, creationDate, manufacturer, futureRelease, releaseDate, detailClass, isTaxed, oversize, name, descriptionSummary, totalSold, featuredItemPriority, price, shippingCost, salesStatus), to-one relationships: (hugeMedia, smallMedia, sale, organization, largeMedia, vendor, store, inventoryItem), to-many relationships: (kitQuantities, categories, orders, relatedToCatalogItems, reviews, upSaleItems, kitGroupItemSpecifications, freebies, relatedCatalogItems, sideSaleItems)) InventoryItem classDescription: class er.extensions.ERXEntityClassDescription (entity name: InventoryItem, attributes: (minimumOrderQuantity, availableQuantity, lastWholesalePrice, shelfQuantity, isDropShipped, quantityPendingArrival, wholesaleCost, discontinued, skuFromSupplier, bin2, minimumAvailableQuantity, expectedReorderArrivalDate, numberSold, bin1), to-one relationships: (supplier, organization), to-many relationships: (catalogItems, itemsOrderedNotReceived, kitQuantities, customersToNotifyWhenInventoryArrives)) ___ 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 [EMAIL PROTECTED]
Re: Snapshot problems
Another explanation occurred to me. Do you have any custom attributes in any of the objects? Are any of them mutable (e.g. NSMutableDictionary, NSMutableArray, a custom class that you wrote)? Yes, many of my classes have custom attributes. CatalogItem has an NSMutableDictionary and an NSMutableArray as custom attributes. I believe some of my EOs also have attributes that are references to custom classes that I have written. Could this be problematic? Are you doing anything else, anywhere, that might be a departure from plain jane EOF? You may be doing something that appears innocent and unrelated which is actually hammering EOF. I am just trying to prod your memory. It's hard to know. What is an example of something you would consider not plain jane EOF? In InventoryItem, I'm overridding the 'set' methods for a couple of attributes that are likely to change frequently underneath EOF so that it can automatically handle Optimistic locking exceptions. An example of something like that is below. Yesterday after some of our email, I got worried that this may be doing something terrible with regards to EOF, and commented it all out so that everything was using the default implementation (and of course this was also the case when I commented out the entire body of each custom class), but it had no impact whatsoever on the test case that started all of this, so I felt more secure that it was ok to do this kind of thing. public void setShelfQuantity( Number newValue ) { Integer existingShelf = (Integer) shelfQuantity(); if ( shelfQuantity() != null availableQuantity() != null rawPrimaryKey() != null ) { int difference = newValue.intValue() - shelfQuantity().intValue (); if ( difference = 0 ) { increaseShelfQuantityBy( difference ); increaseAvailableQuantityBy( difference ); } else { reduceAvailableQuantityBy( difference * -1 ); reduceShelfQuantityBy( difference * -1 ); } } else { super.setShelfQuantity( newValue ); setAvailableQuantity( newValue ); } if ( ( existingShelf == null || existingShelf.intValue() == 0 ) newValue != null newValue.intValue() 0 ) { Enumeration catalogEnum = catalogItems().objectEnumerator(); CatalogItem catalog = null; while ( catalogEnum.hasMoreElements() ) { catalog = (CatalogItem) catalogEnum.nextElement(); if ( catalog.futureRelease().intValue() == 1 ) { catalog.setFutureRelease( new Integer( 0 ) ); } } } } public void increaseShelfQuantityBy( int numberSold ) { super.setShelfQuantity( new Integer( shelfQuantity().intValue() + numberSold ) ); // try to save changes but check for conflicts try { successfulChangeSave(); } catch ( EOGeneralAdaptorException e ) { // conflict!! try again on the refaulted object super.setShelfQuantity( new Integer( shelfQuantity().intValue () + numberSold ) ); try { successfulChangeSave(); } catch ( EOGeneralAdaptorException f ) { NSLog.out.appendln( Multiple conflicts increasing shelf qty!: + shelf: + shelfQuantity() + , avail: + availableQuantity() + \n + ErrorStackTrace.toString( f ) ); } } } public void refresh() { editingContext().invalidateObjectsWithGlobalIDs(new NSArray (editingContext().globalIDForObject(this))); } public void successfulChangeSave() throws EOGeneralAdaptorException { try { editingContext().saveChanges(); } catch ( EOGeneralAdaptorException f ) { refresh(); throw f; } if ( editingContext().parentObjectStore() instanceof EOEditingContext ) { try { ( (EOEditingContext) editingContext().parentObjectStore () ).saveChanges(); } catch (EOGeneralAdaptorException f) { refresh(); throw f; } } } Chuck ___ 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 [EMAIL PROTECTED]
Re: Snapshot problems
On Apr 20, 2007, at 5:41 PM, Chuck Hill wrote: On Apr 20, 2007, at 2:28 PM, Steven Mark McCraw wrote: Another explanation occurred to me. Do you have any custom attributes in any of the objects? Are any of them mutable (e.g. NSMutableDictionary, NSMutableArray, a custom class that you wrote)? Yes, many of my classes have custom attributes. CatalogItem has an NSMutableDictionary and an NSMutableArray as custom attributes. DING DING DING! We have a winner! I believe some of my EOs also have attributes that are references to custom classes that I have written. Could this be problematic? Mutable attributes are death to EOF. That is your problem. Or at least one of them. If you really, really work at it you can probably get it to work, but it is really not worth the effort IMO. Make them immutable. Add cover methods to modify these values: make a mutable clone of the attribute, modify it, make an immutable clone and replace the attribute value. See page 43 of PWO if you have it. If you don't have it, can pretty much assure that you want it! Chuck Wow! Ok, I had no idea. I'll go through and strip all of those out in whatever way is necessary. I have PWO, but I loaned it to another developer at my company for something. Sounds like I need to re-read it, and I figure buying another copy is the least I can do, so I'm buying the eBook. I'll check it out and let you know how it goes. Thanks again, Mark ___ 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 [EMAIL PROTECTED]
Snapshot problems
Hi all, I've been seeing a lot of exceptions/warnings in the logs for one of my applications lately, and all seem to have something to do with an unexpected snapshot state. I'm not really sure what causes this, or where to look next. Has anyone seen these before? The first appears just to be logging from something, and not a full- blown exception: DEBUG NSLog - decrementSnapshotCountForGlobalID: com.webobjects.eoaccess.EODatabase [EMAIL PROTECTED] -- is unable to decrement snapshot count for object with global ID _EOIntegralKeyGlobalID[Media (java.lang.Integer)9755] - count is already 0 or this snapshot doesn't exist I'm also getting a lot of these, which seem like they might be related somehow: Error: java.lang.IllegalStateException Reason: There is no database snapshot available for the object Disc pk:76798 with GlobalID _EOIntegralKeyGlobalID[Disc (java.lang.Integer)76798] EODatabaseContext.java line 4205 method objectsForSourceGlobalID package com.webobjects.eoaccess EOObjectStoreCoordinator.java line 682 method objectsForSourceGlobalID package com.webobjects.eocontrol EOEditingContext.java line 3904 method objectsForSourceGlobalID package com.webobjects.eocontrol ERXEC.java line 1036 method objectsForSourceGlobalID package er.extensions EODatabaseContext.java line 4418 method _fireArrayFault package com.webobjects.eoaccess EOAccessArrayFaultHandler.java line 70 method completeInitializationOfObject package com.webobjects.eoaccess _EOCheapCopyMutableArray.java line 38 method willRead package com.webobjects.eocontrol _EOCheapCopyMutableArray.java line 92 method count package com.webobjects.eocontrol _EOCheapCopyArray.java line 33 method _setArray package com.webobjects.eocontrol EOAccessArrayFaultHandler.java line 151 method completeInitializationOfObject package com.webobjects.eoaccess _EOCheapCopyArray.java line 126 method willRead package com.webobjects.eocontrol _EOCheapCopyArray.java line 95 method objectsNoCopy package com.webobjects.eocontrol NSArray.java line 393 method init package com.webobjects.foundation NSMutableArray.java line 60 method init package com.webobjects.foundation _NSArrayUtilities.java line 197 method arrayExcludingObjectsFromArray package com.webobjects.foundation EODatabaseContext.java line 6100 method recordChangesInEditingContext package com.webobjects.eoaccess EOObjectStoreCoordinator.java line 412 method saveChangesInEditingContext package com.webobjects.eocontrol EOEditingContext.java line 3165 method saveChanges package com.webobjects.eocontrol ERXEC.java line 947 method _saveChanges package er.extensions ERXEC.java line 870 method saveChanges package er.extensions InventoryItem.java line 427 method successfulChangeSave package InventoryItem InventoryItem.java line 799 method increaseShelfQuantityBy package InventoryItem InventoryItem.java line 499 method setShelfQuantity package InventoryItem NativeMethodAccessorImpl.java line NA method invoke0 package sun.reflect NativeMethodAccessorImpl.java line 39 method invoke package sun.reflect DelegatingMethodAccessorImpl.java line 25 method invoke package sun.reflect Method.java line 324 method invoke package java.lang.reflect KeyValueCodingProtectedAccessor.java line 65 method setMethodValue package KeyValueCodingProtectedAccessor NSKeyValueCoding.java line 1175 method setValueInObject package com.webobjects.foundation NSKeyValueCoding.java line 1205 method setValueInObject package com.webobjects.foundation EOCustomObject.java line 1601 method takeValueForKey package com.webobjects.eocontrol NSKeyValueCoding.java line 519 method takeValueForKey package com.webobjects.foundation NSValidation.java line 733 method validateTakeValueForKeyPath package com.webobjects.foundation EOCustomObject.java line 1363 method validateTakeValueForKeyPath package com.webobjects.eocontrol NSValidation.java line 551 method validateTakeValueForKeyPath package com.webobjects.foundation NSValidation.java line 741 method validateTakeValueForKeyPath package com.webobjects.foundation WOComponent.java line 1273 method validateTakeValueForKeyPath package com.webobjects.appserver ... Thanks in Advance, Mark ___ 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 [EMAIL PROTECTED]
How to view EODatabaseContext snapshot
Hi all, I've been working all morning trying to debug cryptic EOF exceptions, and as per the usual with that, am getting nowhere. I can almost replicate some of them, but the behavior is inconsistent and therefore very frustrating. Almost all of them seem to hinge in some way or other on EODatabaseContext whining about its snapshot. Either it can't find a snapshot for an EO that is being deleted, or it can't decrement a snapshot count (that doesn't exist or is already zero), or there is no snapshot available for some object when it is trying to save changes. I am obviously doing something wrong, although I can't figure out where to look. I think it would be extremely helpful in tracking down the issue if there were some way to be able to examine the snapshot of the EODatabaseContext for session ().defaultEditingContex(). I'm guessing (based on the existence of the method EODatabaseContext.localSnapshotForGlobalID(...)) that when the Apple documentation vaguely rambles on and on about the snapshot that what they're really talking about is an NSMutableDictionary keyed on a EOGlobalID whose values are NSDictionaries mapping attribute names to values for Enterprise Objects. Is there some way to just get this overall dictionary so that I can print it out as I go to see where things are getting off track? Am I taking the right approach here? Any advice would be appreciated. Thanks, Mark ___ 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 [EMAIL PROTECTED]
Re: Snapshot problems
Hi Chuck, Thanks for the response. I'm 99.9% sure that I'm locking properly, and the only EOF commandment I might possibly be breaking is the one that says: Don't change the behavior of methods that EOF uses. For example, do not override to-many relationships to return a sorted list of the related objects. Make another method to do this. I'm not overriding to-many relationship methods, but I do sometimes override setters. For example, I might override a particular attribute so that I can make a record of the time that the attribute was changed. Moreover, there are places that I override accessors for formatting purposes. An example of this would be overriding a phoneNumber() method to add formatting to the returned string, or overriding a setPhoneNumber method so that it strips formatting off. Are these things problematic? Thanks, Mark On Apr 19, 2007, at 12:50 PM, Chuck Hill wrote: This pretty much means one of two things: 1. You are not locking properly http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/Using_EOF/ Context_and_Database_Locking 2. You are violating EOF commandments http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/Using_EOF/ The_EOF_Commandments Chuck On Apr 19, 2007, at 7:54 AM, Steven Mark McCraw wrote: Hi all, I've been seeing a lot of exceptions/warnings in the logs for one of my applications lately, and all seem to have something to do with an unexpected snapshot state. I'm not really sure what causes this, or where to look next. Has anyone seen these before? The first appears just to be logging from something, and not a full-blown exception: DEBUG NSLog - decrementSnapshotCountForGlobalID: com.webobjects.eoaccess.EODatabase [EMAIL PROTECTED] -- is unable to decrement snapshot count for object with global ID _EOIntegralKeyGlobalID[Media (java.lang.Integer)9755] - count is already 0 or this snapshot doesn't exist I'm also getting a lot of these, which seem like they might be related somehow: Error: java.lang.IllegalStateException Reason: There is no database snapshot available for the object Disc pk:76798 with GlobalID _EOIntegralKeyGlobalID[Disc (java.lang.Integer)76798] EODatabaseContext.java line 4205 method objectsForSourceGlobalID package com.webobjects.eoaccess EOObjectStoreCoordinator.java line 682 method objectsForSourceGlobalID package com.webobjects.eocontrol EOEditingContext.java line 3904 method objectsForSourceGlobalID package com.webobjects.eocontrol ERXEC.java line 1036 method objectsForSourceGlobalID package er.extensions EODatabaseContext.java line 4418 method _fireArrayFault package com.webobjects.eoaccess EOAccessArrayFaultHandler.java line 70 method completeInitializationOfObject package com.webobjects.eoaccess _EOCheapCopyMutableArray.java line 38 method willRead package com.webobjects.eocontrol _EOCheapCopyMutableArray.java line 92 method count package com.webobjects.eocontrol _EOCheapCopyArray.java line 33 method _setArray package com.webobjects.eocontrol EOAccessArrayFaultHandler.java line 151 method completeInitializationOfObject package com.webobjects.eoaccess _EOCheapCopyArray.java line 126 method willRead package com.webobjects.eocontrol _EOCheapCopyArray.java line 95 method objectsNoCopy package com.webobjects.eocontrol NSArray.java line 393 method init package com.webobjects.foundation NSMutableArray.java line 60 method init package com.webobjects.foundation _NSArrayUtilities.java line 197 method arrayExcludingObjectsFromArray package com.webobjects.foundation EODatabaseContext.java line 6100 method recordChangesInEditingContext package com.webobjects.eoaccess EOObjectStoreCoordinator.java line 412 method saveChangesInEditingContext package com.webobjects.eocontrol EOEditingContext.java line 3165 method saveChanges package com.webobjects.eocontrol ERXEC.java line 947 method _saveChanges package er.extensions ERXEC.java line 870 method saveChanges package er.extensions InventoryItem.java line 427 method successfulChangeSave package InventoryItem InventoryItem.java line 799 method increaseShelfQuantityBy package InventoryItem InventoryItem.java line 499 method setShelfQuantity package InventoryItem NativeMethodAccessorImpl.java line NA method invoke0 package sun.reflect NativeMethodAccessorImpl.java line 39 method invoke package sun.reflect DelegatingMethodAccessorImpl.java line 25 method invoke package sun.reflect Method.java line 324 method invoke package java.lang.reflect KeyValueCodingProtectedAccessor.java line 65 method setMethodValue package KeyValueCodingProtectedAccessor NSKeyValueCoding.java line 1175 method setValueInObject package com.webobjects.foundation NSKeyValueCoding.java line 1205 method setValueInObject package com.webobjects.foundation EOCustomObject.java line 1601 method takeValueForKey package com.webobjects.eocontrol NSKeyValueCoding.java line 519 method takeValueForKey package
Re: Snapshot problems
Hey Chuck, /Library/Receipts tells me I'm on the 5.3.3 update. I have been running with DebugGroupMultithreading for a few days now, and nothing seems to have changed, so I assumed everything was ok there, but it could just be that I set things up wrong. I just added the following lines to my Application constructor: NSLog.debug.setAllowedDebugLevel (NSLog.DebugLevelInformational); NSLog.allowDebugLoggingForGroups (NSLog.DebugGroupEnterpriseObjects | NSLog.DebugGroupMultithreading); Should that do it, or is there something else I need to do? Otherwise, I will go through and clean out anything anywhere that overrides a setter or getter and changes the data being set/get, and I'll see if that makes a difference. Thanks for the suggestions. Mark On Apr 19, 2007, at 3:42 PM, Chuck Hill wrote: Also, are you on the latest WO version? On Apr 19, 2007, at 12:33 PM, Steven Mark McCraw wrote: Hi Chuck, Thanks for the response. I'm 99.9% sure that I'm locking properly, and the only EOF commandment I might possibly be breaking is the one that says: Don't change the behavior of methods that EOF uses. For example, do not override to-many relationships to return a sorted list of the related objects. Make another method to do this. I'm not overriding to-many relationship methods, but I do sometimes override setters. For example, I might override a particular attribute so that I can make a record of the time that the attribute was changed. Moreover, there are places that I override accessors for formatting purposes. An example of this would be overriding a phoneNumber() method to add formatting to the returned string, or overriding a setPhoneNumber method so that it strips formatting off. Are these things problematic? Thanks, Mark On Apr 19, 2007, at 12:50 PM, Chuck Hill wrote: This pretty much means one of two things: 1. You are not locking properly http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/Using_EOF/ Context_and_Database_Locking 2. You are violating EOF commandments http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/Using_EOF/ The_EOF_Commandments Chuck ___ 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 [EMAIL PROTECTED]
Re: Snapshot problems
) at com.webobjects.eoaccess.EODatabaseContext.recordChangesInEditingContext( EODatabaseContext.java:6059) at com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingCo ntext(EOObjectStoreCoordinator.java:412) at com.webobjects.eocontrol.EOEditingContext.saveChanges (EOEditingContext.java:3226) at er.extensions.ERXEC._saveChanges(ERXEC.java:947) at er.extensions.ERXEC.saveChanges(ERXEC.java:870) at EditKitHelper.removeItem(EditKitHelper.java:77) ... Here the editing context identified by b88745 represents the session's editing context, and the exception is thrown when I call saveChanges on the default editing context within the removeItem method. Furthermore, if I print out ec.deletedObjects() right before calling ec.saveChanges (and after _nestedEC.saveChanges), the item to be deleted is there!: ec.deletedObjects(): (KitQuantity pk:1216) So it appears that the nested EC is flushing its information to the default ec correctly, and I can tell that the editingContext's snapshots are fine until very shortly before the operation. Just in case there was something funny going on in the EO's, I commented out every line of code from CatalogItem, InventoryItem, and KitQuantity (the three classes being dealt with here), so that effectively they were all blank implementations, and I still get the same result. This would seem to rule out any possibility of EOF commandment violation. At this point I am over trying to understand what is going on or walk on eggshells to make sure I don't offend EOF's delicate sensibilities. I'm under a deadline and I'm seriously considering just cutting EOF out of the loop and doing the whole thing using straight JDBC, but I hear (and somewhat know from experience) that that approach is a slippery slope to misery, so I thought I would put out a detailed description of what I'm doing just in case anyone sees something glaringly obvious or stupid in my methodology (always a distinct possibility). Any help or thoughts are greatly appreciated. Thanks, Mark On Apr 19, 2007, at 4:34 PM, Chuck Hill wrote: On Apr 19, 2007, at 12:54 PM, Steven Mark McCraw wrote: Hey Chuck, /Library/Receipts tells me I'm on the 5.3.3 update. I have been running with DebugGroupMultithreading for a few days now, and nothing seems to have changed, so I assumed everything was ok there, but it could just be that I set things up wrong. I just added the following lines to my Application constructor: NSLog.debug.setAllowedDebugLevel (NSLog.DebugLevelInformational); NSLog.allowDebugLoggingForGroups (NSLog.DebugGroupEnterpriseObjects | NSLog.DebugGroupMultithreading); Should that do it, or is there something else I need to do? I think that should do it. Otherwise, I will go through and clean out anything anywhere that overrides a setter or getter and changes the data being set/get, and I'll see if that makes a difference. Thanks for the suggestions. The only other things that I can think of that might _possibly_ causing something like this are - misuse of the shared EC - somehow keeping a reference to an EO after its editing context has been disposed - holding a lock on an EC for too lock and it getting out of synch with the snapshots Chuck ___ 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 [EMAIL PROTECTED]
Re: Problem with nested editing contexts
Hi Chuck, As it turns out, I was abusing EOF (although not in a way that has ever been documented by Apple, to my knowledge). In my EOModeler generation template, I was initializing all of the the to-many relationships to empty (but non-null) arrays in the generated constructor to avoid null pointer exceptions all over the place (and/ or to avoid having to write lots of code to check that the relationships were non-null). I took the following steps: a) started using EOGenerator b) updated my EOGenerator templates so that the generated code checks for null in the to-many relationship accessors and returns an empty array if it is null Lo and behold, that fixed the problem. It's frustrating to me that there are so many gotchas in the framework that make it break in very basic places and that have never, ever been documented by Apple (to my knowledge), so much to the point that I have come very close to just giving up WebObjects development all together. But I'm feeling a lot better recently thanks to the support of people like yourself and (what seems to be) a helpful growing user community containing people like the project wonder guys. I feel like WebObjects is once again becoming a good useable, viable development platform in spite of Apple's loathsome lack of support for the product, because of a user community that is taking up the slack. Thanks! Mark On Mar 26, 2007, at 12:53 PM, Chuck Hill wrote: On Mar 24, 2007, at 9:37 PM, Steven Mark McCraw wrote: Hi Chuck, That's was a good thought, and actually I was not locking the child EC. It still strikes me as bizarre that the responsibility of locking and unlocking the editing context is left up to the programmer, but that's just me griping. I am not sure what the original rationale for not providing something at the WOSession level to manage more editing contexts. Also, it looks from the output like ERXEC is getting used (although I haven't done anything explicitly other than importing the project wonder frameworks and subclassing ERXApplication and ERXSession). Isn't that supposed to do automatic locking/ unlocking for you, or is there something I need to add? Could ERXEC be part of the problem? I modified my code by adding a nestedEC.lock() before the saveChanges, and a nestedEC.unlock() after, but to no avail. I still got the same behavior. Any other thoughts about what I might be doing wrong? It seems like such a simple thing I'm trying to do... I trust you have seen Mike's message on this. Alternately, is there any workaround other than storing attribute values in local instance variables which are then just copied into the EO itself right before the save is committed? Would it really be such a terrible idea just to not insert the EO into an editing context until you know you're ready to save? A very terrible idea. Unless, of course, you want to spend even more quality debugging time with your app. ;-) I keep reading things that say that this is a terrible idea, but I've actually been doing it for years with no apparent problems. We call that luck. But because of all the posts, etc. that say it's a bad idea, I'm trying to use the nested EC technique, but quite literally getting nowhere doing even simple things with it. Any advice on what approach I should take? There is no need for a workaround. Somehow, somewhere, you are abusing EOF. Even if you work around this, EOF will just lie in wait and take its revenge elsewhere. I used nested editing contexts. I know lots of others do too. They work just fine if you play nice with EOF. Chuck On Mar 24, 2007, at 6:00 PM, Chuck Hill wrote: Are you locking the child EC? On Mar 24, 2007, at 2:30 PM, Steven Mark McCraw wrote: Hi all, I have recently bumped into a problem with using nested editing contexts to accomplish add/edit workflows. What I'm doing seems simple enough, and correct from my understanding of the documentation. I'm creating a nested editing context: EOEditingContext nestedEC = new EOEditingContext (session.defaultEditingContext); and then creating my EOs in this. When it's time to save, I do the following: nestedEC.saveChanges(); session.defaultEditingContext().saveChanges(); This seems to work fine with newly created items. The problem comes when I try to do that on an item that has been modified. I have printed out a few things within the code to confirm this: when the nested editing context saves its changes, it's supposed to push them into its parent context (or so I thought), but this is definitely not happening. Is this a well known issue? Has anyone seen this before? Am I missing something? A couple of hours of googling turned up nothing for me. The code and its output is shown below. Thanks in advance for any help. NSLog.out.appendln(nestedEC updatedObjects: + nestedEC.updatedObjects
Re: Problem with nested editing contexts
to avoid null pointer exceptions all over the place (and/or to avoid having to write lots of code to check that the relationships were non-null). I took the following steps: You should never need to worry about that. If the to-many relationships are null, you have overridden awakeFromInsertion (and / or awakeFromFetch) and failed to call super.awakeFromInsertion / awakeFromFetch. EOF automatically sets these to empty arrays in the super implementation. b) updated my EOGenerator templates so that the generated code checks for null in the to-many relationship accessors and returns an empty array if it is null You should not need to do that, you still have a problem to hunt down. I am not sure where to look next. I have double checked, and for sure I am calling super's implementation on every method that I override, but I still get null pointer exceptions if I don't explicitly check the relationship accessors. I always thought this was stupid EOF behavior, but had no choice but to override my templates, because it was the behavior I was getting. It might very well be thanks to something I'm doing elsewhere, but not sure where else to looks because I've never been violating any of the rules set forth by the vendor, and now I'm not violating any rules set forth by the non-vendor user community (that I'm aware of). But at any rate, at least the code works in predictable ways now, and the added code in my templates shouldn't impose a noticeable overhead, even if it's theoretically unnecessary. Next time I can afford to spend a few hours researching the problem, I will have another look and see if I can track down something else, or else start an entirely new project to see if I can replicate the behavior there and work backwards from that. I'll let you know and post to the list if I find anything from those exercises. Thanks again for the help! Mark ___ 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 archive@mail-archive.com
Problem with nested editing contexts
Hi all, I have recently bumped into a problem with using nested editing contexts to accomplish add/edit workflows. What I'm doing seems simple enough, and correct from my understanding of the documentation. I'm creating a nested editing context: EOEditingContext nestedEC = new EOEditingContext (session.defaultEditingContext); and then creating my EOs in this. When it's time to save, I do the following: nestedEC.saveChanges(); session.defaultEditingContext().saveChanges(); This seems to work fine with newly created items. The problem comes when I try to do that on an item that has been modified. I have printed out a few things within the code to confirm this: when the nested editing context saves its changes, it's supposed to push them into its parent context (or so I thought), but this is definitely not happening. Is this a well known issue? Has anyone seen this before? Am I missing something? A couple of hours of googling turned up nothing for me. The code and its output is shown below. Thanks in advance for any help. NSLog.out.appendln(nestedEC updatedObjects: + nestedEC.updatedObjects()); NSLog.out.appendln(nestedEC.parent:+ nestedEC.parentObjectStore ()); NSLog.out.appendln(session.defaultEditingContext: + session.defaultEditingContext()); nestedEC.saveChanges(); NSLog.out.appendln(session.defaultEditingContext updatedObjects: + session.defaultEditingContext().updatedObjects()); session.defaultEditingContext().saveChanges(); The output is: nestedEC updatedObjects: (Test, 380.00, null) nestedEC.parent: [EMAIL PROTECTED] session.defaultEditingContext: [EMAIL PROTECTED] session.defaultEditingContext updatedObjects: () The first line shows that there is an updated object in the nested EC The second and third lines show that the ec is actually nested within another editing context and that the nested ec's parent is the session's default editingContext The fourth line shows that after calling saveChanges() in the nested ec, the parent ec still is showing no objects to update Consequently, if I check the database after calling the final saveChanges, my change is not there. ___ 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 archive@mail-archive.com
Re: Problem with nested editing contexts
Hi Chuck, That's was a good thought, and actually I was not locking the child EC. It still strikes me as bizarre that the responsibility of locking and unlocking the editing context is left up to the programmer, but that's just me griping. Also, it looks from the output like ERXEC is getting used (although I haven't done anything explicitly other than importing the project wonder frameworks and subclassing ERXApplication and ERXSession). Isn't that supposed to do automatic locking/unlocking for you, or is there something I need to add? Could ERXEC be part of the problem? I modified my code by adding a nestedEC.lock() before the saveChanges, and a nestedEC.unlock () after, but to no avail. I still got the same behavior. Any other thoughts about what I might be doing wrong? It seems like such a simple thing I'm trying to do... Alternately, is there any workaround other than storing attribute values in local instance variables which are then just copied into the EO itself right before the save is committed? Would it really be such a terrible idea just to not insert the EO into an editing context until you know you're ready to save? I keep reading things that say that this is a terrible idea, but I've actually been doing it for years with no apparent problems. But because of all the posts, etc. that say it's a bad idea, I'm trying to use the nested EC technique, but quite literally getting nowhere doing even simple things with it. Any advice on what approach I should take? Thanks, Mark On Mar 24, 2007, at 6:00 PM, Chuck Hill wrote: Are you locking the child EC? On Mar 24, 2007, at 2:30 PM, Steven Mark McCraw wrote: Hi all, I have recently bumped into a problem with using nested editing contexts to accomplish add/edit workflows. What I'm doing seems simple enough, and correct from my understanding of the documentation. I'm creating a nested editing context: EOEditingContext nestedEC = new EOEditingContext (session.defaultEditingContext); and then creating my EOs in this. When it's time to save, I do the following: nestedEC.saveChanges(); session.defaultEditingContext().saveChanges(); This seems to work fine with newly created items. The problem comes when I try to do that on an item that has been modified. I have printed out a few things within the code to confirm this: when the nested editing context saves its changes, it's supposed to push them into its parent context (or so I thought), but this is definitely not happening. Is this a well known issue? Has anyone seen this before? Am I missing something? A couple of hours of googling turned up nothing for me. The code and its output is shown below. Thanks in advance for any help. NSLog.out.appendln(nestedEC updatedObjects: + nestedEC.updatedObjects()); NSLog.out.appendln(nestedEC.parent:+ nestedEC.parentObjectStore()); NSLog.out.appendln(session.defaultEditingContext: + session.defaultEditingContext()); nestedEC.saveChanges(); NSLog.out.appendln(session.defaultEditingContext updatedObjects: + session.defaultEditingContext().updatedObjects()); session.defaultEditingContext().saveChanges(); The output is: nestedEC updatedObjects: (Test, 380.00, null) nestedEC.parent: [EMAIL PROTECTED] session.defaultEditingContext: [EMAIL PROTECTED] session.defaultEditingContext updatedObjects: () The first line shows that there is an updated object in the nested EC The second and third lines show that the ec is actually nested within another editing context and that the nested ec's parent is the session's default editingContext The fourth line shows that after calling saveChanges() in the nested ec, the parent ec still is showing no objects to update Consequently, if I check the database after calling the final saveChanges, my change is not there. ___ 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 [EMAIL PROTECTED] -- 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 (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 archive@mail-archive.com
Re: using primary and foreign keys as class properties
Hi Pierre, First off, thanks for the response (and thanks to the others who responded earlier). It is good to hear from someone at Apple who is familiar with the code. It sounds like the smart thing to do is not to add keys as class properties directly, since EOF might have some branch in the future that follows through on the assumption that they aren't. I have just begun to really get into the Project Wonder framework, and it looks like ERXGenericRecord provides nice ways to get at the keys easily without writing 3-6 lines of code each time (why didn't I think of the methods that ERXGenericRecord provides earlier?). Thanks to Kieran for that suggestion. As to the question of whether writing custom SQL code is poor design, I certainly don't want to get into an argument about it. I'm sure sticking totally with EOF for database communication has advantages, and I spent many, many hours (probably amounting to weeks or months) trying to keep within those parameters based upon the documentation that I have read that advocates doing so. My real world experience taught me the hard way that sometimes (if you need to do quick optimized fetches on data sets with more than a few thousand records that span several tables) you can save lots and lots of time (not to mention lots and lots of memory) just generating custom SQL to get raw rows. It's far easier to optimize, and you don't have to deal with the time and memory overhead of encapsulating the data as a set of full fledged enterprise objects (In a large hitlist the user will probably not drill down for detail on the vast majority of these rows anyway). The strategy of fetching the display hitlist as raw rows and then creating an EO for use only when a user selects the row for a more detailed view has worked out really well for me, and I've found that managing the SQL isn't really more complicated than managing a complex fetch specification. It's felt very liberating, actually, to code this way, and when combined with using a connection pool for non-EOF database communication, it's very, very fast compared to EOF (even when using all the tricks like prefetching, batch faulting, etc). I've been using this paradigm for several years now and have yet to experience any downside. I've had far less grief with it than the days and days I used to spend trying to optimize EOF to acceptable performance levels (acceptable from the customer's point of view). I'm not trying to pretend that this method is the height of clean design (I'm no more thrilled with embedding complex custom SQL in my application layer than I am with embedding complex EOFetchSpecification construction), but it is pragmatic, and I would encourage developers to at least think through the possible benefits and harms before simply writing it off as an option (as I did for years). It's easy to say that it's a bad approach until you've actually tried it and seen it work. I would welcome any more thoughts or discussion on the subject, and again, appreciate the feedback thus far. Sincerely, Mark On Feb 4, 2007, at 11:30 AM, Mr. Pierre Frisch wrote: Hi Mark, Before setting primary keys as class properties I would really question my design. This question typically occurs when you use the primary to convey meaning about the object and this can usually better be expressed in the object itself. This will give you a better object design and a more readable code. In 10 years developing with WebObjects I am yet to see a problem that could not be worked around that way. Primary key should left at the database layer. The application layer should manipulate EOGlobalID you will save you self and the developer that will fix your code after you a lot of trouble and time by keeping that encapsulation. You are right EOF make the assumption that primary keys are not class property. I do not think anything break in the current version if you make them class properties and consider them as read only but that is not guaranteed for the future. Primary Keys are considered private to the EOControl layer and should only be accessed directly if you are writing extension to that layer. As for optimizing there are lots of way of doing it within EOF and for the same reason you should probably try those very hard before writing custom SQL code. The same apply here I have used all sort of delegate and even written custom qualifiers but I have always stuck to the rule that I do not embed SQL code in the application layer. If you are missing feature to optimize your application please file a bug report. I promise that it will be read. Thanks Pierre -- Pierre Frisch [EMAIL PROTECTED] ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update
using primary and foreign keys as class properties
Hi everyone, I recall reading in some of the early Apple WebObjects documentation that it's a huge terrible thing to mark your foreign and primary keys as class properties (e.g. check the little diamond in EOModeler so that your generated classes give you setters and getters to access them directly). Over the years, I've often thought it would be convenient to have the keys as class properties, particularly when I've had to write custom queries. I know EOUtilities gives you methods to get the primary and foreign keys for an object, but using these are kind of a pain compared to just calling a simple accessor method. I've actually set keys as class properties a few times, but whenever a strange EOF exception cropped up, this was the first thing I always changed back (in a rather superstitious, paranoid way) for fear that somehow having the keys as class properties was giving EOF a fit. I started thinking about it again the other day for some reason, and frankly I can't think of any reason it should have an effect on EOF, so I thought I would pose the question to the list. Is having keys as class properties just something that is for some reason considered bad form by the early documentation writers at Apple (I recall the same documentation firmly asserting that you never need to do anything outside EOF, but in the real world this isn't always practical when you need to optimize)? Or is there in fact something about having keys as class properties that throws a monkey wrench into EOF at unpredictable times? Thanks in advance for help/discussion. Mark ___ 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 archive@mail-archive.com