Re: get confirmation of a payment from other website via a direct action, how to get back to a shopping session?

2009-06-08 Thread Chuck Hill
Is the session terminated if this happens?  I think that is what  
should happen.  How long does it wait before deciding to give up  
waiting for the session to be checked in?


Thanks
Chuck

On Jun 7, 2009, at 4:12 PM, Mr. Pierre Frisch wrote:

I have actually rewritten this code in WO 5.6 and the sessions  
deadlock should be something of the past. The thing is that there is  
no need to way forever for a session to check in. The new approach  
is to have a semaphore and timeout so that threads get released and  
do not wait forever on a fail session.


Cheers

Pierre
--
Pierre Frisch
pie...@apple.com


On May 28, 2009, at 6:55, Anjo Krank wrote:


Am 28.05.2009 um 15:49 schrieb Kieran Kelleher:

Only reason I wouldn't is when I am trying to troubleshoot a  
problem with the awesome ERXSessionStoreDeadlockDetection. Pity it  
does not work with concurrenr request handling on. It probably is  
just not possible. No way ;-)


Nope, it's not possible. The whole idea is that you track requests  
coming serially, which only works reasonably when the app lock  
prevents this from occurring normally.


You *could* create a timer and only log if the last access has been  
longer than X seconds, though...


Cheers, Anjo
___
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/pierre%40apple.com

This email sent to pie...@apple.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/chill%40global-village.net

This email sent to ch...@global-village.net


--
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their  
overall knowledge of WebObjects or who are trying to solve specific  
problems.

http://www.global-village.net/products/practical_webobjects






___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (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: get confirmation of a payment from other website via a direct action, how to get back to a shopping session?

2009-06-07 Thread Mr. Pierre Frisch
I have actually rewritten this code in WO 5.6 and the sessions  
deadlock should be something of the past. The thing is that there is  
no need to way forever for a session to check in. The new approach is  
to have a semaphore and timeout so that threads get released and do  
not wait forever on a fail session.


Cheers

Pierre
--
Pierre Frisch
pie...@apple.com


On May 28, 2009, at 6:55, Anjo Krank wrote:


Am 28.05.2009 um 15:49 schrieb Kieran Kelleher:

Only reason I wouldn't is when I am trying to troubleshoot a  
problem with the awesome ERXSessionStoreDeadlockDetection. Pity it  
does not work with concurrenr request handling on. It probably is  
just not possible. No way ;-)


Nope, it's not possible. The whole idea is that you track requests  
coming serially, which only works reasonably when the app lock  
prevents this from occurring normally.


You *could* create a timer and only log if the last access has been  
longer than X seconds, though...


Cheers, Anjo
___
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/pierre%40apple.com

This email sent to pie...@apple.com




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: get confirmation of a payment from other website via a direct action, how to get back to a shopping session?

2009-05-29 Thread David Avendasora


On May 28, 2009, at 7:41 AM, Johan Henselmans wrote:

Second approach would be to store all the session information (the  
products, user info etc) in a database table, and, once the user  
gets back from the payment, pickup from there, and restore it's  
previous information. But that might mean that the reservation on  
products that have taken place (and are deducted from the available  
products) will wait forever because the user is not returning.


So a thread would have to run all the time and remove all the  
reservations that have not paid in let's say ten minutes.


If you want to run a separate thread to do this type of clean up, I  
suggest using Quartz (http://www.opensymphony.com/quartz/) for doing  
this. I use it to automate Order Importing and other reoccurring data  
integration functions between my WO app and other systems. Quartz has  
all the logic in it already for how to schedule, what to do if a job  
is interrupted or fails, etc. All you really have to do is write the  
business logic for what to do when the scheduler triggers a given job.


I have created a separate WO Application that does this function. It  
uses my foundation framework and the Quartz library and has all the  
schedule definitions. The actual business logic for the integration is  
in the foundation framework so it is easy to manually call the  
functions from within my main app if needed, but the automated  
scheduling and calling is handled by this Scheduled Tasks application.


Since I'm running it as a separate app, I have to be more careful  
about the app and database getting out of sync, but those are pretty  
straight-forward issues, common to most any app.


This solution works extremely well for me.

Dave
___
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: get confirmation of a payment from other website via a direct action, how to get back to a shopping session?

2009-05-28 Thread Anjo Krank

Am 28.05.2009 um 15:49 schrieb Kieran Kelleher:

Only reason I wouldn't is when I am trying to troubleshoot a problem  
with the awesome ERXSessionStoreDeadlockDetection. Pity it does not  
work with concurrenr request handling on. It probably is just not  
possible. No way ;-)


Nope, it's not possible. The whole idea is that you track requests  
coming serially, which only works reasonably when the app lock  
prevents this from occurring normally.


You *could* create a timer and only log if the last access has been  
longer than X seconds, though...


Cheers, Anjo
___
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: get confirmation of a payment from other website via a direct action, how to get back to a shopping session?

2009-05-28 Thread Kieran Kelleher
Only reason I wouldn't is when I am trying to troubleshoot a problem  
with the awesome ERXSessionStoreDeadlockDetection. Pity it does not  
work with concurrenr request handling on. It probably is just not  
possible. No way ;-)


On May 28, 2009, at 9:30 AM, Mike Schrag wrote:

Just to add some caution: be sure to run either multi-threaded or  
see that you don't have long requests that may block the app for a  
longer time.

also  just always run multithreaded. why wouldn't you ...

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/kieran_lists%40mac.com

This email sent to kieran_li...@mac.com


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

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


Re: get confirmation of a payment from other website via a direct action, how to get back to a shopping session?

2009-05-28 Thread Anjo Krank

Am 28.05.2009 um 15:30 schrieb Mike Schrag:

Just to add some caution: be sure to run either multi-threaded or  
see that you don't have long requests that may block the app for a  
longer time.

also  just always run multithreaded. why wouldn't you ...



Come to think of it, just turning MT on may not be enough, as a  
session will also not be entered more than once. So if your user surfs  
a bit more and due to some unforeseen hickup lands on a page that  
won't load for a while, you also get redirected.


Of course, this normally happens way less often.

The take-home message is: if your callback involves money in any way,  
store it permanently and write a cleanup procedure to delete stale  
entries.


Cheers, Anjo

___
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: get confirmation of a payment from other website via a direct action, how to get back to a shopping session?

2009-05-28 Thread Mike Schrag
This IS a consideration of a vulnerability if you LOSE that instance  
inbetween these operations -- Patrick's suggestion of storing as  
much as possible in the db would cover you for that.

er.. "This" = "There"

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


Re: get confirmation of a payment from other website via a direct action, how to get back to a shopping session?

2009-05-28 Thread Mike Schrag
you'll either be using cookies, which species sessionid + instance  
id, or you'll be using URL encodingand your direct action URL will  
have both the instance ID as well as  ?wosid=xxx in the URL (http://yoursite/cgi-bin/WebObjects/YourApp.woa/instanceid/daname?wosid=xxx 
) ... should work fine


ms
Does this also work with several machines running instances? I can  
imagine it works fine on one server, but as far as I know there is  
not some shared context over servers, or is there?
instance number is encoded in the URL or in a cookie ... in a  
standard setup with one apache in front, you will be routed to the  
correct server based on your instance number*, which will then have  
the corresponding session id.  every time someone clicks a link in  
your stateful app, they are getting routed to the same server -- wo  
would just explode in a ball of flames if this didn't function  
properly.


ms

* and if you have a load balancer in front, it obviously needs to  
understand sticky sessions, but again, nothing would work right in  
your app if this wasn't already happening
This IS a consideration of a vulnerability if you LOSE that instance  
inbetween these operations -- Patrick's suggestion of storing as much  
as possible in the db would cover you for that.


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


Re: get confirmation of a payment from other website via a direct action, how to get back to a shopping session?

2009-05-28 Thread Pascal Robert


Le 09-05-28 à 09:33, Mike Schrag a écrit :

you'll either be using cookies, which species sessionid + instance  
id, or you'll be using URL encodingand your direct action URL will  
have both the instance ID as well as  ?wosid=xxx in the URL (http://yoursite/cgi-bin/WebObjects/YourApp.woa/instanceid/daname?wosid=xxx 
) ... should work fine


ms
Does this also work with several machines running instances? I can  
imagine it works fine on one server, but as far as I know there is  
not some shared context over servers, or is there?
instance number is encoded in the URL or in a cookie ... in a  
standard setup with one apache in front, you will be routed to the  
correct server based on your instance number*, which will then have  
the corresponding session id.  every time someone clicks a link in  
your stateful app, they are getting routed to the same server -- wo  
would just explode in a ball of flames if this didn't function  
properly.


ms

* and if you have a load balancer in front, it obviously needs to  
understand sticky sessions, but again, nothing would work right in  
your app if this wasn't already happening



That topic (load balancing) have to be a topic at WOWODC 2010!


---
Pascal Robert

http://www.macti.ca | http://www.linkedin.com/in/macti

Skype | Twitter | AIM/iChat : MacTICanada

___
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: get confirmation of a payment from other website via a direct action, how to get back to a shopping session?

2009-05-28 Thread Mike Schrag
you'll either be using cookies, which species sessionid + instance  
id, or you'll be using URL encodingand your direct action URL will  
have both the instance ID as well as  ?wosid=xxx in the URL (http://yoursite/cgi-bin/WebObjects/YourApp.woa/instanceid/daname?wosid=xxx 
) ... should work fine


ms
Does this also work with several machines running instances? I can  
imagine it works fine on one server, but as far as I know there is  
not some shared context over servers, or is there?
instance number is encoded in the URL or in a cookie ... in a standard  
setup with one apache in front, you will be routed to the correct  
server based on your instance number*, which will then have the  
corresponding session id.  every time someone clicks a link in your  
stateful app, they are getting routed to the same server -- wo would  
just explode in a ball of flames if this didn't function properly.


ms

* and if you have a load balancer in front, it obviously needs to  
understand sticky sessions, but again, nothing would work right in  
your app if this wasn't already happening


___
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: get confirmation of a payment from other website via a direct action, how to get back to a shopping session?

2009-05-28 Thread Mike Schrag
Just to add some caution: be sure to run either multi-threaded or  
see that you don't have long requests that may block the app for a  
longer time.

also  just always run multithreaded. why wouldn't you ...

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


Re: get confirmation of a payment from other website via a direct action, how to get back to a shopping session?

2009-05-28 Thread Patrick Middleton


On 28 May 2009, at 13:57, Anjo Krank wrote:

Just to add some caution: be sure to run either multi-threaded or  
see that you don't have long requests that may block the app for a  
longer time.


Otherwise the adaptor will happily redirect you callback to another  
instance - where the session most likely will not be known...


Cheers, Anjo


+1.

I've dealt with this myself; 3DSecure payment authentication,  
Verified by VISA, and so on.  Tedious as it may seem, I found the way  
forward was to store as much state in the database as possible, so  
that rendezvous with the existing session is not necessary, and that  
the callback can be handled via a direct action.


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

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

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


Re: get confirmation of a payment from other website via a direct action, how to get back to a shopping session?

2009-05-28 Thread Anjo Krank
Just to add some caution: be sure to run either multi-threaded or see  
that you don't have long requests that may block the app for a longer  
time.


Otherwise the adaptor will happily redirect you callback to another  
instance - where the session most likely will not be known...


Cheers, Anjo



Am 28.05.2009 um 13:45 schrieb Mike Schrag:

you'll either be using cookies, which species sessionid + instance  
id, or you'll be using URL encodingand your direct action URL will  
have both the instance ID as well as  ?wosid=xxx in the URL (http://yoursite/cgi-bin/WebObjects/YourApp.woa/instanceid/daname?wosid=xxx 
) ... should work fine


ms

On May 28, 2009, at 7:41 AM, Johan Henselmans wrote:

I have a situation with a shop-site where I communicate some  
shopping details to an external website. The shopper pays it's dues  
over there, and then get's redirected to the shop site. The  
requirements are that the shopper actually has to go to the  
external site in the same browser window: popup's etc are not  
allowed. In the meantime the products are set aside, to make sure  
nobody else gets them while the shopper pays.


Now the a shopper back from somewhere, with two variables: some  
transaction ID that the external party creates and an entrance  
code, that I can create myself.


I have thought of several approaches:

First I thought to use a direct-action to get the information.  
Then, pickup the session where it's left off with all the shopping  
details, check if the payment went all right, and get on to the  
next step. If the user does not return, the session times out and  
the reservation on products are returned to the database.


This approach will only work with one instance  of an application  
on one server. Say there are more instances, than the instance that  
receives the directaction call might not be the one that is still  
holding on to the session.


Second approach would be to store all the session information (the  
products, user info etc) in a database table, and, once the user  
gets back from the payment, pickup from there, and restore it's  
previous information. But that might mean that the reservation on  
products that have taken place (and are deducted from the available  
products) will wait forever because the user is not returning.


So a thread would have to run all the time and remove all the  
reservations that have not paid in let's say ten minutes.


I have a feeling that there might be another approach that is  
better suited. I had a look at the WOPaypal framework, but I did  
not completely understand what was going on there.


Perhaps somebody can explain to me how this works, or is there an  
other approach that people use to solve this problem?


Regards,

Johan Henselmans
http://www.netsense.nl
Tel: +31-20-6267538
Fax: +31-20-6279159



___
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 msch...@mdimension.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/anjo%40krank.net

This email sent to a...@krank.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: get confirmation of a payment from other website via a direct action, how to get back to a shopping session?

2009-05-28 Thread Mike Schrag
you'll either be using cookies, which species sessionid + instance id,  
or you'll be using URL encodingand your direct action URL will have  
both the instance ID as well as  ?wosid=xxx in the URL (http://yoursite/cgi-bin/WebObjects/YourApp.woa/instanceid/daname?wosid=xxx 
) ... should work fine


ms

On May 28, 2009, at 7:41 AM, Johan Henselmans wrote:

I have a situation with a shop-site where I communicate some  
shopping details to an external website. The shopper pays it's dues  
over there, and then get's redirected to the shop site. The  
requirements are that the shopper actually has to go to the external  
site in the same browser window: popup's etc are not allowed. In the  
meantime the products are set aside, to make sure nobody else gets  
them while the shopper pays.


Now the a shopper back from somewhere, with two variables: some  
transaction ID that the external party creates and an entrance code,  
that I can create myself.


I have thought of several approaches:

First I thought to use a direct-action to get the information. Then,  
pickup the session where it's left off with all the shopping  
details, check if the payment went all right, and get on to the next  
step. If the user does not return, the session times out and the  
reservation on products are returned to the database.


This approach will only work with one instance  of an application on  
one server. Say there are more instances, than the instance that  
receives the directaction call might not be the one that is still  
holding on to the session.


Second approach would be to store all the session information (the  
products, user info etc) in a database table, and, once the user  
gets back from the payment, pickup from there, and restore it's  
previous information. But that might mean that the reservation on  
products that have taken place (and are deducted from the available  
products) will wait forever because the user is not returning.


So a thread would have to run all the time and remove all the  
reservations that have not paid in let's say ten minutes.


I have a feeling that there might be another approach that is better  
suited. I had a look at the WOPaypal framework, but I did not  
completely understand what was going on there.


Perhaps somebody can explain to me how this works, or is there an  
other approach that people use to solve this problem?


Regards,

Johan Henselmans
http://www.netsense.nl
Tel: +31-20-6267538
Fax: +31-20-6279159



___
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 msch...@mdimension.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