Re: failed to find a snapshot for EO with Global ID

2012-06-14 Thread Mike Schrag
> So it would seem that the nested ECs are sneaking past this fix and causing 
> havoc. I'm still not sure what about garbage collection triggers this, but 
> I've updated ERXEC so that nested ECs check to see if any of its parents are 
> saving before processing notifications.  The test passes with that change in 
> place. 
The GC + child editing context thing sounds like a problem we ran into a couple 
years ago ... From my notes:

"The essence of the problem is that EO's track retain count as an ivar. This 
retain count records how many nested ec's contain that EO as well, because they 
share a snapshot (with refcount = 1). If, however, the parent EO gets garbage 
collected while the nested EC version of it is still alive, the parent EO's 
retain count disappears and it throws off the snapshot ref counting.

We talked about this and bounced around a couple ideas, but ultimately the one 
that seemed to have the least side-effects was to track the retain count in the 
EC rather than the EO. This patch provides an impl of that concept -- retain 
count is now removed from EO and pushed up into a dictionary in the EC. Now 
even if the underlying EO gets GC'd, the retain counts won't be lost."

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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: failed to find a snapshot for EO with Global ID

2012-06-14 Thread Alexis Tual
Wow, great job Ramsey !

Alex

2012/6/14 Ramsey Gurley 

> I think I've narrowed this down a bit :-)  If I add
>
> NSNotificationCenter nc = NSNotificationCenter.defaultCenter();
> nc.removeObserver(nested, EOObjectStore.ObjectsChangedInStoreNotification,
> null);
>
> Just before the last ec.saveChanges(), the save is successful.  Looking in
> ERXEC, I see
>
> /**
>  * Overridden so add a bugfix from Lenny Marks
>  */
> @Override
> public void _objectsChangedInStore(NSNotification nsnotification) {
> ERXEnterpriseObject.FlushCachesProcessor.perform(this, (NSArray)
> nsnotification.userInfo().objectForKey("objects"));
> if (savingChanges) {
> synchronized (queuedNotifications) {
> queuedNotifications.addObject(nsnotification);
> }
> }
> else {
> super._objectsChangedInStore(nsnotification);
> }
> }
>
> For background, here's the original thread from Lenny Marks
>
> http://markmail.org/message/kqyvvptath2fp6ez
>
> So it would seem that the nested ECs are sneaking past this fix and
> causing havoc. I'm still not sure what about garbage collection triggers
> this, but I've updated ERXEC so that nested ECs check to see if any of its
> parents are saving before processing notifications.  The test passes with
> that change in place.
>
> I've got it up on the SmartHealth fork of wonder.  If you guys are
> interested, then give it a try and see if it works for you. There doesn't
> appear to be any testing of nested ECs that I can see in ERXTest, but I
> don't think this will have any negative consequences.
>
>
> https://github.com/smarthealth/wonder/commit/bed35de926d0fe53c207b2fea7f5e3d1922d0ddb
>
> I'm deploying this out to a dev server now to see if any more snapshots go
> missing. If all goes well, I'll pull this change into the main wonder fork.
>
> Ramsey
>
>
> On Jun 12, 2012, at 2:22 PM, Alexis Tual wrote:
>
> I'm also very curious about Ramsey's investigations because when this bug
> happens, you have to basically toss your EC stack...
>
> Alex
>
> 2012/6/13 Calven Eggert 
>
>> I'm very curious to see your findings.  One of our WO apps have had this
>> problem for years but it happens so infrequently that the users don't seem
>> to be bothered.  It bothers me though. argh.
>>
>>
>> On 2012-06-12, at 11:47 AM,  <
>> webobjects-dev-requ...@lists.apple.com> wrote:
>>
>> Ah, so it's the garbage collection that's triggering it. I should have
>> known, given the looping worked for small values.  This is good. I can
>> distill the failure down to a single pair of EOs using System.gc() now.
>>  This should make it a lot easier to investigate.
>>
>> public void testNestedECs() {
>>  try {
>>   EOEditingContext ec = ERXEC.newEditingContext();
>>  Company c = (Company) EOUtilities.createAndInsertInstance(ec,
>> Company.ENTITY_NAME);
>>  c.setName("Name");
>>  ec.saveChanges();
>>  EOEditingContext nested = ERXEC.newEditingContext(ec);
>>  Company nestC = c.localInstanceIn(nested);
>>  Employee e = (Employee) EOUtilities.createAndInsertInstance(nested,
>> Employee.ENTITY_NAME);
>>  e.setFirstName("First");
>>  e.setLastName("Last");
>>  e.setManager(Boolean.FALSE);
>>  e.addObjectToBothSidesOfRelationshipWithKey(nestC, Employee.
>> COMPANY_KEY);
>>  nested.saveChanges();
>>  ec.saveChanges();
>>  System.gc();
>>  c.delete();
>>  ec.saveChanges();
>>  } catch (Exception e) {
>>  e.printStackTrace();
>>  Assert.fail(e.getMessage());
>>  }
>> }
>>
>> Thanks Alexis,
>>
>> Ramsey
>>
>>
>>
>>  ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
>> Help/Unsubscribe/Update your Subscription:
>>
>> https://lists.apple.com/mailman/options/webobjects-dev/alexis.tual%40gmail.com
>>
>> This email sent to alexis.t...@gmail.com
>>
>>
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
>
> https://lists.apple.com/mailman/options/webobjects-dev/rgurley%40smarthealth.com
>
> This email sent to rgur...@smarthealth.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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Late WOWODC purchases

2012-06-14 Thread Pascal Robert
Hi guys,

If one of you is coming to WOWODC but still didn't get their ticket, remember 
that you have up to June 21 to buy your ticket. But more important, I need to 
give the final headcount to the hotel next week, so if you are planning to come 
and I don't have your name on my list, please email me.

See you in two weeks!
 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Is this the joda thing that is being discussed earlier this week?

2012-06-14 Thread Ramsey Gurley
http://jenkins.wocommunity.org/job/Wonder/javadoc/er/attributeextension/package-summary.html

:-)

On Jun 14, 2012, at 10:31 AM, Theodore Petrosky wrote:

> I have a classic Wonder App that is working just fine. However, I want to add 
> some login capability and auditing and attachments. 
> 
> I have a framework for the model so I decided to use D2W for the interface as 
> I have been playing with D2W and I am starting to feel Ok with it.
> 
> My problem is that the model has some Entities that contain attributes of 
> type jodaLocalDate.
> 
> as soon as I try to list the Entity my app explodes with:
> 
> Application:   POGridD2W
> Error: java.lang.NoSuchMethodException: Class org.joda.time.LocalDate 
> does not implement method jodaLocalDate
> Reason:Class org.joda.time.LocalDate does not implement method 
> jodaLocalDate
> 
> Or am I doing something like not adding a needed framework?
> 
> Ted
> ___
> 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:
> https://lists.apple.com/mailman/options/webobjects-dev/rgurley%40smarthealth.com
> 
> This email sent to rgur...@smarthealth.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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Is this the joda thing that is being discussed earlier this week?

2012-06-14 Thread Theodore Petrosky
I have a classic Wonder App that is working just fine. However, I want to add 
some login capability and auditing and attachments. 

I have a framework for the model so I decided to use D2W for the interface as I 
have been playing with D2W and I am starting to feel Ok with it.

My problem is that the model has some Entities that contain attributes of type 
jodaLocalDate.

as soon as I try to list the Entity my app explodes with:

Application: POGridD2W
Error:   java.lang.NoSuchMethodException: Class org.joda.time.LocalDate does 
not implement method jodaLocalDate
Reason:  Class org.joda.time.LocalDate does not implement method jodaLocalDate

Or am I doing something like not adding a needed framework?

Ted
 ___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: 5.4 uploading large files

2012-06-14 Thread Helmut Tschemernjak


Downloading large files works fine, for uploads there are several bugs 
in the WO code. I reported it via the Apple bug reporter some time ago. 
Problem ID: 10765546


There is no workaround, here is some input in case somebody from Apple 
is looking into it:


The class com.webobjects.appserver._private.WOHttpIO tries to parse the 
content-length header with the method parseInt of the Integer class. 
This will fail for all files larger than 2.1GB. Further there are many 
instances in the code that make use of an integer for the content length 
of a request:

WOInputStreamData: public WOInputStreamData(InputStream, int)
WORequest: public int _contentLengthHeader()
Also classes not directly involved in the request handling do show such 
a limitation (e.g. public NSRange(int, int)).


PS: looking forward to see many of you at WOWODC 2012 in Montreal

Regards

Helmut Tschemernjak


On 13.06.12 09:45, Johann Werner wrote:

Just hitting the same problem for uploading files > 5GB. Does anyone has 
already done some work relating to that problem?


Am 05.03.2012 um 00:51 schrieb Q:


On 05/03/2012, at 9:40 AM, Lachlan Deck wrote:


Hey Alan,

On 05/03/2012, at 9:32 AM, Alan Ward wrote:


Speaking for myself (and definitely not on behalf of my employer) I'm curious 
where you are coming from here?  Did you have a contract that obligated Apple 
to continue to support you? What grounds to you believe you have for a law 
suit?  I'm just curious.

Yes it's a somewhat comical notion :-)

Just to make your point/question clearer for people: the said product was 
supplied for free for the last few releases. So if people were to sue for 
damages, it would need to be a very strong case indeed! I'm sure Apple would be 
happy to supply a full refund ;-)

More seriously, I think the sentiment is coming from promises (or assumed 
promises) that were made when, for example, the Xcode tools were dropped. The 
reasoning given was to concentrate on enhancing the frameworks. Thus the 
initial impression given to the community by Apple (bolstered by its funding of 
tools like WOLips) was that a renewed energy was being put into WO by Apple 
that people could continue to build their business apps with. And, there was 
some initial promise of better community involvement in the evolution of WO 
when the Apple maven repo was made available (which showed some future versions 
in the works). It didn't last long though which was a shame at the time, 
especially for us maven users. Hmm so, perhaps it was the community's 
unwillingness to embrace maven that canned it moving forward :-)

What are you trying to say? Maven killed WebObjects? Why am I not surprised. :)


cheers,
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:
https://lists.apple.com/mailman/options/webobjects-dev/helmut%40helios.de

This email sent to hel...@helios.de


___
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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


RE: ERXPageTracker question

2012-06-14 Thread Mark Cassidy
Thx Kieran for the nice example.  That's great.

From: Kieran Kelleher [mailto:kelleh...@gmail.com]
Sent: Thursday, June 14, 2012 12:09 PM
To: Mark Cassidy
Cc: webobjects-dev@lists.apple.com
Subject: Re: ERXPageTracker question

You can just roll your own tracker and track any string you like (build a 
pseudo URL, for example frameworkname/WOComponentname), since component action 
URLs won't be of much use I think.

Here is an example of a custom tracker component that resides in an application 
PageWrapper - it should be obvious how it works. Copy/paste/modify/profit. :-)

java
---

package wk.cheetah.statistics;

import org.apache.log4j.Logger;

import wk.foundation.WKStringUtilities;
import wk.webobjects.appserver.WKAbstractStatelessComponent;

import com.webobjects.appserver.WOComponent;
import com.webobjects.appserver.WOContext;

public class CTPageTracker extends WKAbstractStatelessComponent {

@SuppressWarnings("unused")
private static final Logger log = 
Logger.getLogger(CTPageTracker.class);

public CTPageTracker(WOContext context) {
super(context);
}


private String _gaScript;

/** @return the script for google analytics page tracking */
public String gaScript() {
if ( _gaScript == null ) {
StringBuilder b = new StringBuilder();
b.append("var _gaq = _gaq || [];\n");
b.append("_gaq.push(['_setAccount', 
'ENTER-YOUR-OWN-ID-HERE']);");
b.append("_gaq.push(['_setDomainName', 
'none']);");
b.append("_gaq.push(['_setAllowLinker', 
true]);");

String pageName = null;
WOComponent page = context().page();
if (page != null) {
String frameworkName = 
page.frameworkName();
if (frameworkName == null) {
frameworkName = 
"app";
}
pageName = "/" + frameworkName 
+ "/" + WKStringUtilities.lastElementOfString(page.name(), ".");
} else {
pageName = "UNKNOWN";
}
if (log.isDebugEnabled())
log.debug("pageName = " + 
(pageName == null ? "null" : pageName.toString()));

b.append("_gaq.push(['_trackPageview','" + 
pageName + "']);\n");
b.append("(function() {\n");
b.append("var ga = 
document.createElement('script'); ga.type = 'text/javascript'; ga.async = 
true;\n");
b.append("ga.src = ('https:' == 
document.location.protocol ? 'https://ssl' : 'http://www') + 
'.google-analytics.com/ga.js';\n");
b.append("var s = 
document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, 
s);\n");
b.append("})();\n");

_gaScript = b.toString();
}
return _gaScript;
}
}



html







On Jun 14, 2012, at 11:51 AM, Mark Cassidy wrote:


Hi,

If we used ERXPageTracker with Component Actions would that be sufficient for 
Google Analytics?  --Don't want to use Direct Actions if we can help it.

Thanks for any 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:
https://lists.apple.com/mailman/options/webobjects-dev/kelleherk%40gmail.com

This email sent to kelleh...@gmail.com

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: ERXPageTracker question

2012-06-14 Thread Kieran Kelleher
You can just roll your own tracker and track any string you like (build a 
pseudo URL, for example frameworkname/WOComponentname), since component action 
URLs won't be of much use I think.

Here is an example of a custom tracker component that resides in an application 
PageWrapper - it should be obvious how it works. Copy/paste/modify/profit. :-)

java
---

package wk.cheetah.statistics;

import org.apache.log4j.Logger;

import wk.foundation.WKStringUtilities;
import wk.webobjects.appserver.WKAbstractStatelessComponent;

import com.webobjects.appserver.WOComponent;
import com.webobjects.appserver.WOContext;

public class CTPageTracker extends WKAbstractStatelessComponent {

@SuppressWarnings("unused")
private static final Logger log = Logger.getLogger(CTPageTracker.class);

public CTPageTracker(WOContext context) {
super(context);
}


private String _gaScript;

/** @return the script for google analytics page tracking */
public String gaScript() {
if ( _gaScript == null ) {
StringBuilder b = new StringBuilder();
b.append("var _gaq = _gaq || [];\n");
b.append("_gaq.push(['_setAccount', 
'ENTER-YOUR-OWN-ID-HERE']);");
b.append("_gaq.push(['_setDomainName', 'none']);");
b.append("_gaq.push(['_setAllowLinker', true]);");

String pageName = null;
WOComponent page = context().page();
if (page != null) {
String frameworkName = page.frameworkName();
if (frameworkName == null) {
frameworkName = "app";
}
pageName = "/" + frameworkName + "/" + 
WKStringUtilities.lastElementOfString(page.name(), ".");
} else {
pageName = "UNKNOWN";
}
if (log.isDebugEnabled())
log.debug("pageName = " + (pageName == null ? 
"null" : pageName.toString()));

b.append("_gaq.push(['_trackPageview','" + pageName + 
"']);\n");
b.append("(function() {\n");
b.append("var ga = 
document.createElement('script'); ga.type = 'text/javascript'; ga.async = 
true;\n");
b.append("ga.src = ('https:' == 
document.location.protocol ? 'https://ssl' : 'http://www') + 
'.google-analytics.com/ga.js';\n");
b.append("var s = 
document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, 
s);\n");
b.append("})();\n");

_gaScript = b.toString();
}
return _gaScript;
}
}



html







On Jun 14, 2012, at 11:51 AM, Mark Cassidy wrote:

> Hi,
>  
> If we used ERXPageTracker with Component Actions would that be sufficient for 
> Google Analytics?  --Don’t want to use Direct Actions if we can help it.
>  
> Thanks for any 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:
> https://lists.apple.com/mailman/options/webobjects-dev/kelleherk%40gmail.com
> 
> This email sent to kelleh...@gmail.com

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


ERXPageTracker question

2012-06-14 Thread Mark Cassidy
Hi,

If we used ERXPageTracker with Component Actions would that be sufficient for 
Google Analytics?  --Don't want to use Direct Actions if we can help it.

Thanks for any 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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com