Launching task after an object creation (D2W)

2010-12-06 Thread Francesco Romano
Hi.
I have a d2w application with two pages: a "list movies" and a "add movie".
What I want to do is call a background task after a movie is added in the db (I 
have to call an applescript script that can take a lot of time depending of 
movie size..)
Where should I add the

ConverterTask task = new 
ConverterTask((EOGlobalID)ERXEOControlUtilities.convertEOtoGID(m));
ERXExecutorService.executorService().execute(task);

I tried in the Movie.java file, but the CreateMovie method is not called in 
D2W...

Thank you

Francesco

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

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

Re: Launching task after an object creation (D2W)

2010-12-06 Thread Kieran Kelleher
ERXGenericRecord.didInsert().   Override that. 

Regards, Kieran.


On Dec 6, 2010, at 6:57 AM, Francesco Romano  wrote:

> Hi.
> I have a d2w application with two pages: a "list movies" and a "add movie".
> What I want to do is call a background task after a movie is added in the db 
> (I have to call an applescript script that can take a lot of time depending 
> of movie size..)
> Where should I add the
> 
> ConverterTask task = new 
> ConverterTask((EOGlobalID)ERXEOControlUtilities.convertEOtoGID(m));
> ERXExecutorService.executorService().execute(task);
> 
> I tried in the Movie.java file, but the CreateMovie method is not called in 
> D2W...
> 
> Thank you
> 
> Francesco
> 
> ___
> 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/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:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

x-webobjects-request-id lacking uniqueness?

2010-12-06 Thread Patrick Middleton
I have an app doing something superficially like web services which  
is sessionless and accessed via DirectActions.  Because of other  
activity in the database sometimes, database i/o can block for  
several minutes.  When this happens the Apache WebObjects adaptor's  
loadbalancing features come into play, and redirect the request it  
sent to an apparently unresponsive instance to a different instance,  
which may in turn block on database i/o.  The caller's browser waits  
several minutes and then receives an "no instance available" page.   
When the other activity in the database clears an, if the request  
caused a database update, that update can be applied multiple times  
because of each instance attempting to process the request.  If the  
first update changes the database in a way that prevents the other  
updates from succeeding, they might report "update failed", and if  
the database i/o hold up was only a few minutes, that page can be  
returned to the caller -- a page saying that the update failed, when  
in fact the update succeeded but the caller won't get to see that page.


What I thought about doing, and have largely done, is announce and  
listen for activity via multicast datagrams.  If an instance receives  
a request via a direct action and I don't want it to be redirected  
via the load balancer, enough information is broadcast such that  
other instances waiting for requests will be able to tell that  
another instance should already be processing it, and then generate a  
response (without blocking on database i/o) to the effect that  
database congestion may be in progress, that their request is being  
processed, any database updates may or may not be committed but will  
be committed at most once.


But what constitutes "enough information"?  The WebObjects adaptor  
adds a header "x-webobjects-request-id" (aka REQUEST_ID_HEADER, in  
config.h) to a received request before writing it to an instance  
(this header is not "leaked back" to the client) and this appears to  
be unique: 24 chars long corresponding to three hexstrings of 32-bit  
numbers, being the time at which some initialization code was called  
in the process (httpd), the process identifier (of httpd), and a  
unique sequence counter defended by a lock.  The point at which this  
header is added means that a redirected request will have the same x- 
webobjects-request-id header.


And so to the subject line of this message: "x-webobjects-request-id  
lacking uniqueness?"  Of those 24 chars, the first 16 are effectively  
fixed whenever httpd starts, and I appear to be seeing values being  
reused for the last 8.  I'd guess that either the shared memory or  
the locking isn't working as expected.


Anybody else seeing this?

---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.uk



This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: x-webobjects-request-id lacking uniqueness?

2010-12-06 Thread r...@synapticstorm.com
Hi Patrick,

Couldn't you just use WOLongResponse so that it keeps the first connection 
alive until it responds?

Regards,

Rob.

On 6 Dec 2010, at 13:09, Patrick Middleton wrote:

> I have an app doing something superficially like web services which is 
> sessionless and accessed via DirectActions.  Because of other activity in the 
> database sometimes, database i/o can block for several minutes.  When this 
> happens the Apache WebObjects adaptor's loadbalancing features come into 
> play, and redirect the request it sent to an apparently unresponsive instance 
> to a different instance, which may in turn block on database i/o.  The 
> caller's browser waits several minutes and then receives an "no instance 
> available" page.  When the other activity in the database clears an, if the 
> request caused a database update, that update can be applied multiple times 
> because of each instance attempting to process the request.  If the first 
> update changes the database in a way that prevents the other updates from 
> succeeding, they might report "update failed", and if the database i/o hold 
> up was only a few minutes, that page can be returned to the caller -- a page 
> saying that the update failed, when in fact the update succeeded but the 
> caller won't get to see that page.
> 
> What I thought about doing, and have largely done, is announce and listen for 
> activity via multicast datagrams.  If an instance receives a request via a 
> direct action and I don't want it to be redirected via the load balancer, 
> enough information is broadcast such that other instances waiting for 
> requests will be able to tell that another instance should already be 
> processing it, and then generate a response (without blocking on database 
> i/o) to the effect that database congestion may be in progress, that their 
> request is being processed, any database updates may or may not be committed 
> but will be committed at most once.
> 
> But what constitutes "enough information"?  The WebObjects adaptor adds a 
> header "x-webobjects-request-id" (aka REQUEST_ID_HEADER, in config.h) to a 
> received request before writing it to an instance (this header is not "leaked 
> back" to the client) and this appears to be unique: 24 chars long 
> corresponding to three hexstrings of 32-bit numbers, being the time at which 
> some initialization code was called in the process (httpd), the process 
> identifier (of httpd), and a unique sequence counter defended by a lock.  The 
> point at which this header is added means that a redirected request will have 
> the same x-webobjects-request-id header.
> 
> And so to the subject line of this message: "x-webobjects-request-id lacking 
> uniqueness?"  Of those 24 chars, the first 16 are effectively fixed whenever 
> httpd starts, and I appear to be seeing values being reused for the last 8.  
> I'd guess that either the shared memory or the locking isn't working as 
> expected.
> 
> Anybody else seeing this?
> 
> ---
> Regards Patrick
> OneStep Solutions (Research) LLP
> www.onestep.co.uk
> 
> 
> 
> This email, including any attachments, is confidential and intended solely 
> for the person or organisation to whom it is addressed. If you are not the 
> intended recipient you must not disseminate, distribute or copy any part of 
> this email nor take any action in reliance on it.
> 
> If you have received this in error please notify the sender immediately by 
> email or phone +44 (0)1702 426400 and delete this email and any attachments 
> from your system.
> 
> Email transmission cannot be guaranteed to be secure or error-free as 
> information could be intercepted, corrupted, lost, destroyed, arrive late or 
> incomplete, or contain viruses. The sender therefore does not accept 
> liability for any errors or omissions in the contents of this message which 
> arise as a result of email transmission. If verification is required please 
> request a hard-copy version.
> 
> OneStep Solutions LLP is registered in England and Wales under registration 
> number OC337173 and has its registered office at 457 Southchurch Road, 
> Southend-on-Sea, Essex SS1 2PH.
> ___
> 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/rob%40synapticstorm.com
> 
> This email sent to r...@synapticstorm.com

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

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


Re: x-webobjects-request-id lacking uniqueness?

2010-12-06 Thread Patrick Middleton


On 6 Dec 2010, at 13:52, r...@synapticstorm.com wrote:


Hi Patrick,

Couldn't you just use WOLongResponse so that it keeps the first  
connection alive until it responds?


Regards,

Rob.


Without going into too much detail -- no.

---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.uk



This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: Launching task after an object creation (D2W)

2010-12-06 Thread Francesco Romano
Thank you..
So simple :)

Francesco

On 06/dic/2010, at 13.15, Kieran Kelleher wrote:

> ERXGenericRecord.didInsert().   Override that. 
> 
> Regards, Kieran.
> 
> 
> On Dec 6, 2010, at 6:57 AM, Francesco Romano  wrote:
> 
>> Hi.
>> I have a d2w application with two pages: a "list movies" and a "add movie".
>> What I want to do is call a background task after a movie is added in the db 
>> (I have to call an applescript script that can take a lot of time depending 
>> of movie size..)
>> Where should I add the
>> 
>> ConverterTask task = new 
>> ConverterTask((EOGlobalID)ERXEOControlUtilities.convertEOtoGID(m));
>> ERXExecutorService.executorService().execute(task);
>> 
>> I tried in the Movie.java file, but the CreateMovie method is not called in 
>> D2W...
>> 
>> Thank you
>> 
>> Francesco
>> 
>> ___
>> 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/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:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: x-webobjects-request-id lacking uniqueness?

2010-12-06 Thread Simon
i was thinking the same - alternatively:

- do whatever is you are doing in a background thread
- switch on concurrent request handling, as i presume that it is actually
the request that is blocking, not the DB as unless your are using something
like m$ access (eeek!) then i would imagine your DB can actually do more
than one thing at once
- if you are using m$ access, change it if you can, or resign if you can't
- re-work locking strategy to force an optimistic locking failure if more
than one update goes through - even if that involves sticking a dummy
attribute in that just increments with each transaction

what you are suggesting feels a bit like sticking some pedals on a car
because the engine keeps stalling - probably best to fix the engine :-)

simon


On 6 December 2010 13:52, r...@synapticstorm.com wrote:

> Hi Patrick,
>
> Couldn't you just use WOLongResponse so that it keeps the first connection
> alive until it responds?
>
> Regards,
>
> Rob.
>
> On 6 Dec 2010, at 13:09, Patrick Middleton wrote:
>
> > I have an app doing something superficially like web services which is
> sessionless and accessed via DirectActions.  Because of other activity in
> the database sometimes, database i/o can block for several minutes.  When
> this happens the Apache WebObjects adaptor's loadbalancing features come
> into play, and redirect the request it sent to an apparently unresponsive
> instance to a different instance, which may in turn block on database i/o.
>  The caller's browser waits several minutes and then receives an "no
> instance available" page.  When the other activity in the database clears
> an, if the request caused a database update, that update can be applied
> multiple times because of each instance attempting to process the request.
>  If the first update changes the database in a way that prevents the other
> updates from succeeding, they might report "update failed", and if the
> database i/o hold up was only a few minutes, that page can be returned to
> the caller -- a page saying that the update failed, when in fact the update
> succeeded but the caller won't get to see that page.
> >
> > What I thought about doing, and have largely done, is announce and listen
> for activity via multicast datagrams.  If an instance receives a request via
> a direct action and I don't want it to be redirected via the load balancer,
> enough information is broadcast such that other instances waiting for
> requests will be able to tell that another instance should already be
> processing it, and then generate a response (without blocking on database
> i/o) to the effect that database congestion may be in progress, that their
> request is being processed, any database updates may or may not be committed
> but will be committed at most once.
> >
> > But what constitutes "enough information"?  The WebObjects adaptor adds a
> header "x-webobjects-request-id" (aka REQUEST_ID_HEADER, in config.h) to a
> received request before writing it to an instance (this header is not
> "leaked back" to the client) and this appears to be unique: 24 chars long
> corresponding to three hexstrings of 32-bit numbers, being the time at which
> some initialization code was called in the process (httpd), the process
> identifier (of httpd), and a unique sequence counter defended by a lock.
>  The point at which this header is added means that a redirected request
> will have the same x-webobjects-request-id header.
> >
> > And so to the subject line of this message: "x-webobjects-request-id
> lacking uniqueness?"  Of those 24 chars, the first 16 are effectively fixed
> whenever httpd starts, and I appear to be seeing values being reused for the
> last 8.  I'd guess that either the shared memory or the locking isn't
> working as expected.
> >
> > Anybody else seeing this?
> >
> > ---
> > Regards Patrick
> > OneStep Solutions (Research) LLP
> > www.onestep.co.uk
> >
> >
> >
> > This email, including any attachments, is confidential and intended
> solely for the person or organisation to whom it is addressed. If you are
> not the intended recipient you must not disseminate, distribute or copy any
> part of this email nor take any action in reliance on it.
> >
> > If you have received this in error please notify the sender immediately
> by email or phone +44 (0)1702 426400 and delete this email and any
> attachments from your system.
> >
> > Email transmission cannot be guaranteed to be secure or error-free as
> information could be intercepted, corrupted, lost, destroyed, arrive late or
> incomplete, or contain viruses. The sender therefore does not accept
> liability for any errors or omissions in the contents of this message which
> arise as a result of email transmission. If verification is required please
> request a hard-copy version.
> >
> > OneStep Solutions LLP is registered in England and Wales under
> registration number OC337173 and has its registered office at 457
> Southchurch Road, Southend-on-Sea, Essex SS1 2PH.
> > ___

Re: x-webobjects-request-id lacking uniqueness?

2010-12-06 Thread Patrick Middleton


On 6 Dec 2010, at 14:20, Simon wrote:


i was thinking the same - alternatively:

- do whatever is you are doing in a background thread
- switch on concurrent request handling, as i presume that it is  
actually the request that is blocking, not the DB as unless your  
are using something like m$ access (eeek!) then i would imagine  
your DB can actually do more than one thing at once
- if you are using m$ access, change it if you can, or resign if  
you can't
- re-work locking strategy to force an optimistic locking failure  
if more than one update goes through - even if that involves  
sticking a dummy attribute in that just increments with each  
transaction


what you are suggesting feels a bit like sticking some pedals on a  
car because the engine keeps stalling - probably best to fix the  
engine :-)


simon



What I am doing is reporting a bug in the WebObjects API adaptor,  
with the circumstances as how how I encountered it.  It might be  
possible to deduce, for example, that the application list etc (see  
config.c in the Adaptors project) is in shared memory, while  
uniqueID_counter (see transaction.c) is not in shared memory, but  
should be, if we cared.


Anybody reading this list who is interested in the adaptor?


---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.uk



This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: x-webobjects-request-id lacking uniqueness?

2010-12-06 Thread Mark Ritchie
Good Morning,

On 6/Dec/2010, at 5:09 AM, Patrick Middleton wrote:
> If an instance receives a request via a direct action and I don't want it to 
> be redirected via the load balancer, enough information is broadcast such 
> that other instances waiting for requests will be able to tell that another 
> instance should already be processing it,
'Should' is a strong word here. I don't think that I'd be relying on in.  
Perhaps I'm pessimistic? 

> and then generate a response (without blocking on database i/o) to the effect 
> that database congestion may be in progress, that their request is being 
> processed, any database updates may or may not be committed but will be 
> committed at most once.
Given that you've put rather bluntly that long request configuration won't work 
for you, I'm not sure how you expect to achieve this across multiple instances 
without building the infrastructure yourself.

On 6/Dec/2010, at 7:06 AM, Patrick Middleton wrote:
> What I am doing is reporting a bug in the WebObjects API adaptor, with the 
> circumstances as how how I encountered it.  It might be possible to deduce, 
> for example, that the application list etc (see config.c in the Adaptors 
> project) is in shared memory, while uniqueID_counter (see transaction.c) is 
> not in shared memory, but should be, if we cared.
> Anybody reading this list who is interested in the adaptor?

Patches welcome!
M.

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

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


Re: x-webobjects-request-id lacking uniqueness?

2010-12-06 Thread Patrick Middleton


On 6 Dec 2010, at 15:27, Mark Ritchie wrote:


Good Morning,

On 6/Dec/2010, at 5:09 AM, Patrick Middleton wrote:
If an instance receives a request via a direct action and I don't  
want it to be redirected via the load balancer, enough information  
is broadcast such that other instances waiting for requests will  
be able to tell that another instance should already be processing  
it,
'Should' is a strong word here. I don't think that I'd be relying  
on it.  Perhaps I'm pessimistic?


Or, perhaps, there was more information that was not provided as it  
was not relevant to the problem at hand (x-webobjects-request-id  
values not as unique as expected) and yet which my MD might deem  
confidential intellectual property.  This approach is adequately  
sound for me.




and then generate a response (without blocking on database i/o) to  
the effect that database congestion may be in progress, that their  
request is being processed, any database updates may or may not be  
committed but will be committed at most once.
Given that you've put rather bluntly that long request  
configuration won't work for you,


Bluntly?  Well yes I suppose, but  you should have seen the  
drafts I discarded!



I'm not sure how you expect to achieve this across multiple  
instances without building the infrastructure yourself.


Which is what I did ... multicast datagram socket.




On 6/Dec/2010, at 7:06 AM, Patrick Middleton wrote:
What I am doing is reporting a bug in the WebObjects API adaptor,  
with the circumstances as how how I encountered it.  It might be  
possible to deduce, for example, that the application list etc  
(see config.c in the Adaptors project) is in shared memory, while  
uniqueID_counter (see transaction.c) is not in shared memory, but  
should be, if we cared.

Anybody reading this list who is interested in the adaptor?


Patches welcome!


Cough.  Yes.  I dare say they are.

-- Patrick



This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


ERRest XML Entity Names

2010-12-06 Thread Benjamin Miller
I've not long started a new WO project after a couple of years away (from Java 
& WO). This is also my first Wonder project so I'm not sure if I'm missing 
something quick and obvious so I'd thought I'd ask. I'm using ERRest to provide 
access to the app's data and have a couple of problems. 


I have an entity, and class, named SuiteRun. When I want a list of SuiteRuns I 
get the XML below.

GET /cgi-bin/WebObjects/Patrol.woa/ra/suite_runs HTTP/1.1



  …
  …
…


I would have expected the root XML element to be pluralized but the individual 
container names to be singular as below.




Is the above behaviour normal for ERRest or am I doing something wrong? 

Thanks

Benjamin Miller

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

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


Re: ERRest XML Entity Names

2010-12-06 Thread Farrukh Ijaz
Set the following property in your project's Properties file.

ERXRest.pluralEntityNames=false

Farrukh

On 2010-12-06, at 8:37 PM, Benjamin Miller wrote:

> I've not long started a new WO project after a couple of years away (from 
> Java & WO). This is also my first Wonder project so I'm not sure if I'm 
> missing something quick and obvious so I'd thought I'd ask. I'm using ERRest 
> to provide access to the app's data and have a couple of problems. 
> 
> 
> I have an entity, and class, named SuiteRun. When I want a list of SuiteRuns 
> I get the XML below.
> 
> GET /cgi-bin/WebObjects/Patrol.woa/ra/suite_runs HTTP/1.1
> 
> 
> 
>  …
>  …
> …
> 
> 
> I would have expected the root XML element to be pluralized but the 
> individual container names to be singular as below.
> 
> 
> 
> 
> Is the above behaviour normal for ERRest or am I doing something wrong? 
> 
> Thanks
> 
> Benjamin Miller
> 
> ___
> 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/farrukh.ijaz%40fuegodigitalmedia.com
> 
> This email sent to farrukh.i...@fuegodigitalmedia.com

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

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

ERRest Update Op Fails

2010-12-06 Thread Benjamin Miller
I'm using ERRest to provide access to a number of entities in my app. Updating 
values in one entity fails silently and I can't figure out where to look. I 
suspect this may not be related to ERRest but when I'm using the same model and 
classes in other 'more traditional' (for me) areas of my app, there are no 
problems. Other entities using the same method update fine and the other CRUD 
actions behave normally.

I perform an update request:

PUT /cgi-bin/WebObjects/Patrol.woa/ra/suite_runs/10 HTTP/1.1


  11



I'm using modified example code to handle the request:

public WOActionResults updateAction() {
SuiteRun suiteRun = routeObjectForKey("suiteRun");  
update(suiteRun, listFilter());
editingContext().saveChanges();
return response(suiteRun, showFilter());
}

public ERXKeyFilter updateFilter() {
ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
filter.include(SuiteRun.TESTS);
filter.include(SuiteRun.TEST_INVOCATIONS);
return filter;
}

The object to update looks OK, so does the EC used. update() appears to work 
and the new values are pushed into the EO. The EO isn't persisted to the 
database and the EC doesn't register any changes. As the EO is populated with 
the new values, a correct response is returned to the client. The save fail is 
silent and nothing appears in logs. 

Any ideas where to start looking?

Thanks,
Benjamin

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

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


Re: ERRest Update Op Fails

2010-12-06 Thread Farrukh Ijaz

On 2010-12-06, at 8:58 PM, Benjamin Miller wrote:

> I'm using ERRest to provide access to a number of entities in my app. 
> Updating values in one entity fails silently and I can't figure out where to 
> look. I suspect this may not be related to ERRest but when I'm using the same 
> model and classes in other 'more traditional' (for me) areas of my app, there 
> are no problems. Other entities using the same method update fine and the 
> other CRUD actions behave normally.
> 
> I perform an update request:
> 
> PUT /cgi-bin/WebObjects/Patrol.woa/ra/suite_runs/10 HTTP/1.1
> 
> 
>  11
> 
> 
> 
> I'm using modified example code to handle the request:
> 
> public WOActionResults updateAction() {
>   SuiteRun suiteRun = routeObjectForKey("suiteRun");  
>   update(suiteRun, listFilter());

It looks like you're using a wrong filter for update. I think you should use 
something like following:

update(suiteRun, ERXKeyFilter.filterWithAttributes());

What I suspect is the listFilter() is used to return fewer attributes in the 
response. This omits the mandatory. When you want to update, you have to use 
the the filter which does not omit any of the mandatory values. E.g.

Farrukh


>   editingContext().saveChanges();
>   return response(suiteRun, showFilter());
>   }
> 
>   public ERXKeyFilter updateFilter() {
>   ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
>   filter.include(SuiteRun.TESTS);
>   filter.include(SuiteRun.TEST_INVOCATIONS);
>   return filter;
>   }
> 
> The object to update looks OK, so does the EC used. update() appears to work 
> and the new values are pushed into the EO. The EO isn't persisted to the 
> database and the EC doesn't register any changes. As the EO is populated with 
> the new values, a correct response is returned to the client. The save fail 
> is silent and nothing appears in logs. 
> 
> Any ideas where to start looking?
> 
> Thanks,
> Benjamin
> 
> ___
> 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/farrukh.ijaz%40fuegodigitalmedia.com
> 
> This email sent to farrukh.i...@fuegodigitalmedia.com

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

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


Re: x-webobjects-request-id lacking uniqueness?

2010-12-06 Thread Chuck Hill

On Dec 6, 2010, at 6:20 AM, Simon wrote:

> i was thinking the same - alternatively:
> 
> - do whatever is you are doing in a background thread
> - switch on concurrent request handling, as i presume that it is actually the 
> request that is blocking, not the DB as unless your are using something like 
> m$ access (eeek!) then i would imagine your DB can actually do more than one 
> thing at once

It would be EOF that is blocking when the OSC gets locks.  Concurrent request 
handling won't address the problem that Patrick is seeing.  It would just be  
the difference between one thread waiting on EOF and one thread  waiting on EOF 
and N threads waiting on the OSC lock.  Using multiple EOF stacks will address 
this unless the point of contention really is in the database.


Chuck


> - if you are using m$ access, change it if you can, or resign if you can't
> - re-work locking strategy to force an optimistic locking failure if more 
> than one update goes through - even if that involves sticking a dummy 
> attribute in that just increments with each transaction
> 
> what you are suggesting feels a bit like sticking some pedals on a car 
> because the engine keeps stalling - probably best to fix the engine :-)
> 
> simon
> 
> 
> On 6 December 2010 13:52, r...@synapticstorm.com  
> wrote:
> Hi Patrick,
> 
> Couldn't you just use WOLongResponse so that it keeps the first connection 
> alive until it responds?
> 
> Regards,
> 
> Rob.
> 
> On 6 Dec 2010, at 13:09, Patrick Middleton wrote:
> 
> > I have an app doing something superficially like web services which is 
> > sessionless and accessed via DirectActions.  Because of other activity in 
> > the database sometimes, database i/o can block for several minutes.  When 
> > this happens the Apache WebObjects adaptor's loadbalancing features come 
> > into play, and redirect the request it sent to an apparently unresponsive 
> > instance to a different instance, which may in turn block on database i/o.  
> > The caller's browser waits several minutes and then receives an "no 
> > instance available" page.  When the other activity in the database clears 
> > an, if the request caused a database update, that update can be applied 
> > multiple times because of each instance attempting to process the request.  
> > If the first update changes the database in a way that prevents the other 
> > updates from succeeding, they might report "update failed", and if the 
> > database i/o hold up was only a few minutes, that page can be returned to 
> > the caller -- a page saying that the update failed, when in fact the update 
> > succeeded but the caller won't get to see that page.
> >
> > What I thought about doing, and have largely done, is announce and listen 
> > for activity via multicast datagrams.  If an instance receives a request 
> > via a direct action and I don't want it to be redirected via the load 
> > balancer, enough information is broadcast such that other instances waiting 
> > for requests will be able to tell that another instance should already be 
> > processing it, and then generate a response (without blocking on database 
> > i/o) to the effect that database congestion may be in progress, that their 
> > request is being processed, any database updates may or may not be 
> > committed but will be committed at most once.
> >
> > But what constitutes "enough information"?  The WebObjects adaptor adds a 
> > header "x-webobjects-request-id" (aka REQUEST_ID_HEADER, in config.h) to a 
> > received request before writing it to an instance (this header is not 
> > "leaked back" to the client) and this appears to be unique: 24 chars long 
> > corresponding to three hexstrings of 32-bit numbers, being the time at 
> > which some initialization code was called in the process (httpd), the 
> > process identifier (of httpd), and a unique sequence counter defended by a 
> > lock.  The point at which this header is added means that a redirected 
> > request will have the same x-webobjects-request-id header.
> >
> > And so to the subject line of this message: "x-webobjects-request-id 
> > lacking uniqueness?"  Of those 24 chars, the first 16 are effectively fixed 
> > whenever httpd starts, and I appear to be seeing values being reused for 
> > the last 8.  I'd guess that either the shared memory or the locking isn't 
> > working as expected.
> >
> > Anybody else seeing this?
> >
> > ---
> > Regards Patrick
> > OneStep Solutions (Research) LLP
> > www.onestep.co.uk
> >
> >
> >
> > This email, including any attachments, is confidential and intended solely 
> > for the person or organisation to whom it is addressed. If you are not the 
> > intended recipient you must not disseminate, distribute or copy any part of 
> > this email nor take any action in reliance on it.
> >
> > If you have received this in error please notify the sender immediately by 
> > email or phone +44 (0)1702 426400 and delete this email and any attachments 
> > from your system.
> >
> >

Re: Timestamps and PostgreSQL

2010-12-06 Thread Chuck Hill
Is there a Wiki page for EOF and Postgres?  It strikes me as this is something 
that should be documented.  I don't think  we can "fix" it, as it would impact 
people with existing data.


On Dec 5, 2010, at 1:38 AM, Paul Hoadley wrote:

> I just couldn't let this go.  Anyone not using PostgreSQL can tune out.
> 
> On 04/12/2010, at 9:47 AM, Paul Hoadley wrote:
> 
 Displaying those times _without_ a formatter in the app shows the first 
 timestamp as '2010-12-03 04:51:55 Etc/GMT' which is exactly as expected, 
 but the second (that was entered from the console behind the app's back) 
 as '2010-12-02 18:21:55 Etc/GMT'.
 
 Is it obvious to any other PostgreSQL users what is going on?  It looks 
 like the database server's machine-local timezone is being used to adjust 
 the timestamp somewhere between WebObjects and the database.
>>> 
>>> I agree.
>> 
>> After some furious Googling, it turns out that the JDBC driver is affected 
>> by the 'user.timezone' system property.  Launching the app with 
>> '-Duser.timezone=GMT' on my laptop (which otherwise gets set to 
>> 'Australia/Adelaide') results in the behaviour I was expecting.  I assume 
>> this was the missing link in the "UTC from top to bottom" chain, as I can 
>> see from the logs that both app servers were picking up their respective 
>> local values for this property.  Just to be clear, this doesn't actually 
>> matter too much if the app is just running indefinitely on the same server: 
>> the timestamps seem to be adjusted on the way in and back out of the 
>> database, so that everything Just Works from within the app.  It was only 
>> when I dumped and restored the database somewhere else that it became a 
>> problem.
> 
> The JDBC driver is, indeed, adjusting the timestamp, and apparently this is a 
> feature.  EOF calls PreparedStatement.setTimestamp(int, Timestamp) 
> (implemented in AbstractJdbc2Statement), which in turn calls 
> PreparedStatement.setTimestamp(int, Timestamp, Calendar) with a null 
> Calendar.  To format the timestamp, TimestampUtils.toString(Calendar, 
> Timestamp) is called, again with a null Calendar.  The null Calendar is 
> replaced by a new GregorianCalendar(), which is used to format the string 
> sent to the database.  All of this is fine, _except_ that the 
> GregorianCalendar's timezone turns out to be the machine-local timezone, 
> despite calling TimeZone.setDefault(TimeZone.getTimeZone("GMT")) in the 
> application's constructor.  (It's not obvious to me why this would be the 
> case—does TimeZone.setDefault() not apply JVM-wide?)  In any case, setting 
> the user.timezone system property (to UTC) _is_ sufficient to cause that 
> GregorianCalendar to be constructed with its timezone set to UTC, and then 
> the JDBC driver doesn't perform any adjustments to timestamps on the way in 
> or out.
> 
> The PostgreSQL JDBC driver's behaviour strikes me as somewhat 
> counter-intuitive, to say the least.  I'm pretty sure it nails the issue of 
> keeping timestamps in UTC with Postgres, though.
> 
> 
> -- 
> Paul.
> 
> http://logicsquad.net/
> 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
> 
> This email sent to ch...@global-village.net

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects









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

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

D2W automatically assign a value to an attribute

2010-12-06 Thread Francesco Romano
Ok.. today I'm asking stupid questions.. but.. D2W is not so simple with the 
rule system :)
I have a page (CreateMovie) which is displayed only if a user is logged in (I 
disabled the automatic login and added a condition in the navigation menu bind 
to session.isUserLoggedIn).
I have a required attribute in the Movie entity named "uploader". What I want 
to do is not allow the user to insert that name, but retrieve it from 
session.username().
How can I do this? I tried a lot of things, but either they don't work or they 
give exception..

Francesco

PS: the big picture is to make the login on a LDAP server, and then save the 
username in the session.

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

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


Re: D2W automatically assign a value to an attribute

2010-12-06 Thread David Holt
Change the display component from a input field to a string.

100 : (pageConfiguration = 'CreateDocument' and propertyKey = 
'documentProvider.fullName') => componentName = "ERD2WDisplayString" 
[com.webobjects.directtoweb.Assignment]

David

On 2010-12-06, at 1:35 PM, Francesco Romano wrote:

> Ok.. today I'm asking stupid questions.. but.. D2W is not so simple with the 
> rule system :)
> I have a page (CreateMovie) which is displayed only if a user is logged in (I 
> disabled the automatic login and added a condition in the navigation menu 
> bind to session.isUserLoggedIn).
> I have a required attribute in the Movie entity named "uploader". What I want 
> to do is not allow the user to insert that name, but retrieve it from 
> session.username().
> How can I do this? I tried a lot of things, but either they don't work or 
> they give exception..
> 
> Francesco
> 
> PS: the big picture is to make the login on a LDAP server, and then save the 
> username in the session.
> 
> ___
> 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/programmingosx%40mac.com
> 
> This email sent to programming...@mac.com

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

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


Re: D2W automatically assign a value to an attribute

2010-12-06 Thread David LeBer

On 2010-12-06, at 4:35 PM, Francesco Romano wrote:

> Ok.. today I'm asking stupid questions.. but.. D2W is not so simple with the 
> rule system :)
> I have a page (CreateMovie) which is displayed only if a user is logged in (I 
> disabled the automatic login and added a condition in the navigation menu 
> bind to session.isUserLoggedIn).
> I have a required attribute in the Movie entity named "uploader". What I want 
> to do is not allow the user to insert that name, but retrieve it from 
> session.username().
> How can I do this? I tried a lot of things, but either they don't work or 
> they give exception..
> 
> Francesco
> 
> PS: the big picture is to make the login on a LDAP server, and then save the 
> username in the session.

If what you are asking is how to set the username on the EO try:

Use awakeFromInsertion or (ERXGenericRecord's) willInsert to set the username 
in the EO, obtaining the username from ERXThreadStorage.

Push the username into ERXThreadStorage in the Session awake().

;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://codeferous.com
blog:   http://davidleber.net
profile:http://www.linkedin.com/in/davidleber
twitter:http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org




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

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


Re: Timestamps and PostgreSQL

2010-12-06 Thread Paul Hoadley
On 07/12/2010, at 6:13 AM, Chuck Hill wrote:

> Is there a Wiki page for EOF and Postgres?  It strikes me as this is 
> something that should be documented.  I don't think  we can "fix" it, as it 
> would impact people with existing data.

I can put it here:

http://wiki.objectstyle.org/confluence/display/WO/Database+Compatibility+and+Comparisons-PostgreSQL

I'm just trying to nail down one last detail.  I've noted that calling 
TimeZone.setDefault() in the Application constructor doesn't seem to occur 
early enough to influence the JDBC driver's creation of its default 
GregorianCalendar.  Setting user.timezone works, but it _doesn't_ work from a 
Properties file, which would have been ideal.  The only method that works is 
setting -Duser.timezone=UTC as a launch argument, which is a pain because I 
have to remember to do it every time I set up a new app.  Is there any way I 
can get some code called even earlier than the Application constructor?


-- 
Paul.

http://logicsquad.net/


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

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


Re: Timestamps and PostgreSQL

2010-12-06 Thread Ramsey Gurley


On Dec 6, 2010, at 5:10 PM, Paul Hoadley wrote:


On 07/12/2010, at 6:13 AM, Chuck Hill wrote:

Is there a Wiki page for EOF and Postgres?  It strikes me as this  
is something that should be documented.  I don't think  we can  
"fix" it, as it would impact people with existing data.


I can put it here:

http://wiki.objectstyle.org/confluence/display/WO/Database+Compatibility+and+Comparisons-PostgreSQL

I'm just trying to nail down one last detail.  I've noted that  
calling TimeZone.setDefault() in the Application constructor doesn't  
seem to occur early enough to influence the JDBC driver's creation  
of its default GregorianCalendar.  Setting user.timezone works, but  
it _doesn't_ work from a Properties file, which would have been  
ideal.  The only method that works is setting -Duser.timezone=UTC as  
a launch argument, which is a pain because I have to remember to do  
it every time I set up a new app.  Is there any way I can get some  
code called even earlier than the Application constructor?



--
Paul.

http://logicsquad.net/


I might be mistaken, but I don't think you can get any earlier than  
main():


public static void main(String argv[]) {
TimeZone.setDefault(...);
ERXApplication.main(argv, Application.class);
}


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

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

Re: D2W automatically assign a value to an attribute

2010-12-06 Thread Ramsey Gurley


On Dec 6, 2010, at 4:44 PM, David LeBer wrote:



On 2010-12-06, at 4:35 PM, Francesco Romano wrote:

Ok.. today I'm asking stupid questions.. but.. D2W is not so simple  
with the rule system :)
I have a page (CreateMovie) which is displayed only if a user is  
logged in (I disabled the automatic login and added a condition in  
the navigation menu bind to session.isUserLoggedIn).
I have a required attribute in the Movie entity named "uploader".  
What I want to do is not allow the user to insert that name, but  
retrieve it from session.username().
How can I do this? I tried a lot of things, but either they don't  
work or they give exception..


Francesco

PS: the big picture is to make the login on a LDAP server, and then  
save the username in the session.


If what you are asking is how to set the username on the EO try:

Use awakeFromInsertion or (ERXGenericRecord's) willInsert to set the  
username in the EO, obtaining the username from ERXThreadStorage.


Push the username into ERXThreadStorage in the Session awake().

;david


What David(s) said, + using ERCoreBusinessLogic.  It does just that  
and gives you some additional goodies like persistent user preferences  
for d2w, audit trails, and mailable exceptions.


Ramsey

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

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


Re: Timestamps and PostgreSQL

2010-12-06 Thread Chuck Hill

On Dec 6, 2010, at 2:10 PM, Paul Hoadley wrote:

> On 07/12/2010, at 6:13 AM, Chuck Hill wrote:
> 
>> Is there a Wiki page for EOF and Postgres?  It strikes me as this is 
>> something that should be documented.  I don't think  we can "fix" it, as it 
>> would impact people with existing data.
> 
> I can put it here:
> 
> http://wiki.objectstyle.org/confluence/display/WO/Database+Compatibility+and+Comparisons-PostgreSQL

Perhaps more likely to be found here:
http://wiki.objectstyle.org/confluence/display/WO/Project+WONDER-Frameworks-PostgresqlPlugin


> I'm just trying to nail down one last detail.  I've noted that calling 
> TimeZone.setDefault() in the Application constructor doesn't seem to occur 
> early enough to influence the JDBC driver's creation of its default 
> GregorianCalendar.  Setting user.timezone works, but it _doesn't_ work from a 
> Properties file, which would have been ideal.  The only method that works is 
> setting -Duser.timezone=UTC as a launch argument, which is a pain because I 
> have to remember to do it every time I set up a new app.  Is there any way I 
> can get some code called even earlier than the Application constructor?

I suspect the problem is that the driver is in /Library/Java/Extensions and so 
is getting loaded and initialized by the boot class loader (or is that root 
class loader?  Q will know.).  If that is where it is, try removing it from 
there and adding it to /Libraries in your application.  That should delay 
loading until after the Properties values are available.


Chuck


-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects









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

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

Re: Timestamps and PostgreSQL

2010-12-06 Thread Andrew Lindesay

Hi Ramsey;

Possibly not helpful, but you can stick this construct inside the class;

static
{
  ... do stuff ...
}

I guess that runs before main() because it has to initialise the class 
before it can run code in it.


cheers.


I might be mistaken, but I don't think you can get any earlier than main():

public static void main(String argv[]) {
TimeZone.setDefault(...);
ERXApplication.main(argv, Application.class);
}


--
Andrew Lindesay
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 arch...@mail-archive.com


Re: Timestamps and PostgreSQL

2010-12-06 Thread Ramsey Gurley

Oh yeah... static initializers and variables come first. D'oh!

I think Chuck made an excellent point too. If that turns out to be the  
case, I think there's room for one last EOF commandment (Thou shalt  
not /Library/Java/Extensions)


Ramsey

On Dec 6, 2010, at 5:51 PM, Andrew Lindesay wrote:


Hi Ramsey;

Possibly not helpful, but you can stick this construct inside the  
class;


static
{
 ... do stuff ...
}

I guess that runs before main() because it has to initialise the  
class before it can run code in it.


cheers.

I might be mistaken, but I don't think you can get any earlier than  
main():


public static void main(String argv[]) {
TimeZone.setDefault(...);
ERXApplication.main(argv, Application.class);
}


--
Andrew Lindesay
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/ramsey%40xeotech.com

This email sent to ram...@xeotech.com



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

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


Re: x-webobjects-request-id lacking uniqueness?

2010-12-06 Thread Ralf Schuchardt


Patrick Middleton schrieb:


And so to the subject line of this message: "x-webobjects-request-id
lacking uniqueness?"  Of those 24 chars, the first 16 are effectively
fixed whenever httpd starts,


> and I appear to be seeing values being

reused for the last 8.


It sounds as if you are dropping the first 16 chars when comparing the 
unique IDs? This would be a bad idea, as there can be more httpds at the 
same time, each with his own counter.



 I'd guess that either the shared memory or
the locking isn't working as expected.


The adapter code is using standard pthreads calls for locking and it 
seems not doing anything wrong.



What I am doing is reporting a bug in the WebObjects API adaptor, with
the circumstances as how how I encountered it. It might be possible to
deduce, for example, that the application list etc (see config.c in the
Adaptors project) is in shared memory, while uniqueID_counter (see
transaction.c) is not in shared memory, but should be, if we cared.


Putting the uniqueID_counter into shared memory seems unnecessary, it 
should be protected by process id and process start time (as long as you 
are using only one webserver).


Are you really seeing _complete_ unique ids reused?

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

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


Re: Timestamps and PostgreSQL

2010-12-06 Thread Paul Hoadley
On 07/12/2010, at 9:10 AM, Ramsey Gurley wrote:

> I might be mistaken, but I don't think you can get any earlier than main():
> 
> public static void main(String argv[]) {
>   TimeZone.setDefault(...);
>   ERXApplication.main(argv, Application.class);
> }

That does work.


-- 
Paul.

http://logicsquad.net/


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

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

Re: Timestamps and PostgreSQL

2010-12-06 Thread Paul Hoadley
On 07/12/2010, at 9:16 AM, Chuck Hill wrote:

> On Dec 6, 2010, at 2:10 PM, Paul Hoadley wrote:
> 
>> On 07/12/2010, at 6:13 AM, Chuck Hill wrote:
>> 
>>> Is there a Wiki page for EOF and Postgres?  It strikes me as this is 
>>> something that should be documented.  I don't think  we can "fix" it, as it 
>>> would impact people with existing data.
>> 
>> I can put it here:
>> 
>> http://wiki.objectstyle.org/confluence/display/WO/Database+Compatibility+and+Comparisons-PostgreSQL
> 
> Perhaps more likely to be found here:
> http://wiki.objectstyle.org/confluence/display/WO/Project+WONDER-Frameworks-PostgresqlPlugin

OK.

>> I'm just trying to nail down one last detail.  I've noted that calling 
>> TimeZone.setDefault() in the Application constructor doesn't seem to occur 
>> early enough to influence the JDBC driver's creation of its default 
>> GregorianCalendar.  Setting user.timezone works, but it _doesn't_ work from 
>> a Properties file, which would have been ideal.  The only method that works 
>> is setting -Duser.timezone=UTC as a launch argument, which is a pain because 
>> I have to remember to do it every time I set up a new app.  Is there any way 
>> I can get some code called even earlier than the Application constructor?
> 
> I suspect the problem is that the driver is in /Library/Java/Extensions

Yeah, that's where I've got it.

> and so is getting loaded and initialized by the boot class loader (or is that 
> root class loader?  Q will know.).  If that is where it is, try removing it 
> from there and adding it to /Libraries in your application.  That should 
> delay loading until after the Properties values are available.

Surprisingly, that _doesn't_ work.  I see:

  user.timezone=UTC

And then later in the TimestampUtils constructor:

TimestampUtils.TimestampUtils: System.getProperty("user.timezone") = UTC
TimestampUtils.TimestampUtils: defaultCal.getTimeZone() = 
sun.util.calendar.ZoneInfo[id="Australia/Adelaide"...

defaultCal is its default GregorianCalendar that's causing the problem.


-- 
Paul.

http://logicsquad.net/


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

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

Re: Timestamps and PostgreSQL

2010-12-06 Thread Paul Hoadley
Hi Andrew,

On 07/12/2010, at 9:21 AM, Andrew Lindesay wrote:

> Possibly not helpful, but you can stick this construct inside the class;
> 
> static
> {
>  ... do stuff ...
> }
> 
> I guess that runs before main() because it has to initialise the class before 
> it can run code in it.

Actually, that's very helpful, as I can stick that in a custom class between 
Application and ERXApplication and I don't need to do anything in 
Application.main().


-- 
Paul.

http://logicsquad.net/


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

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


Consensus on legacy documentation on the Wiki

2010-12-06 Thread Paul Hoadley
Hello,

Just as an aside while I'm adding something to the PostgresqlPlugIn page, is 
there a consensus on what to do with legacy documentation on the Wiki?  There 
are two subheadings on that page on ancient topics: "PostgreSQL EOModeler 
Bundle" and "Using PostgreSQL in EOModeler".  For now, I've moved them to the 
end under a "Legacy topics" parent heading, but at least some of the 
information in those sections is stale even if you were still using EOModeler, 
and there's a link to the abandoned wikibooks.org site.  Can we let this stuff 
go, or do people think there is still value in it?


-- 
Paul.

http://logicsquad.net/


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

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


Re: Consensus on legacy documentation on the Wiki

2010-12-06 Thread David Avendasora
There is a "Deprecated" section in each of the Wiki spaces. I'd cut the 
old/stale stuff out of the current page and paste it into a new Postgress page 
under there. Let's keep it around since there's crazy people out there using 
old versions of everything.

Even WO 5.3.3

Dave

On Dec 6, 2010, at 8:47 PM, Paul Hoadley wrote:

> Hello,
> 
> Just as an aside while I'm adding something to the PostgresqlPlugIn page, is 
> there a consensus on what to do with legacy documentation on the Wiki?  There 
> are two subheadings on that page on ancient topics: "PostgreSQL EOModeler 
> Bundle" and "Using PostgreSQL in EOModeler".  For now, I've moved them to the 
> end under a "Legacy topics" parent heading, but at least some of the 
> information in those sections is stale even if you were still using 
> EOModeler, and there's a link to the abandoned wikibooks.org site.  Can we 
> let this stuff go, or do people think there is still value in it?
> 
> 
> -- 
> Paul.
> 
> http://logicsquad.net/
> 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com
> 
> This email sent to webobje...@avendasora.com
> 
> 

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

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


Re: Consensus on legacy documentation on the Wiki

2010-12-06 Thread Paul Hoadley
On 07/12/2010, at 12:46 PM, David Avendasora wrote:

> There is a "Deprecated" section in each of the Wiki spaces. I'd cut the 
> old/stale stuff out of the current page and paste it into a new Postgress 
> page under there. Let's keep it around since there's crazy people out there 
> using old versions of everything.
> 
> Even WO 5.3.3

OK, will do.  Thanks Dave.


-- 
Paul.

http://logicsquad.net/


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

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


2010 videos?

2010-12-06 Thread Theodore Petrosky
I was wondering (no pun intended) about any of the videos from the 2010 WO 
convention? I am especially interested in anything resembling tutorials on 
Jasper Reports and WO.

Maybe I can find someone that is interested in giving a private lesson. I don't 
have lotsa resources ($) but I am hopeful to find help.

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

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