ross bertolonoi

Greenhorn
+ Follow
since Nov 24, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ross bertolonoi

Hi everyone
I need your advise on general Webservice interface design.

Basically I need to know if I should have one operation with a parameter called rule as input and then the web-service impl will decide what kind of logic to execute based on the value of the rule parameter or have multiple operations for each rule?
For instance :
One single operation
myoperation(String rule, ....) and rule can have values such as rule1, rule2 . The WS impl will look at the value of the rule and execute some logic.
vs .
Having multiple operations
myoperationForRule1(...)
myoperationForRule2(...)
....


Thanks
Ross
5 years ago
my hands are tight . I can't change the flow of requests.(Above I've simplied the flow significantly, there are many black box components involved which can not be touched).

How about keeping allowAddingItem as a global parameter between sessions?
Servlet-1 looks it up using customerid and if this parameter is true, it doesn't set allowAddingItem to true.
Servlet-1 sets this global param to true if the condition is true.

allowAddingItem = get value of allowAddingItem for customerID.
if(number of items for customer-1 in DB == 0 && allowAddingItem is not true)
{
allowAddingItem = true;
add allowAddingItem for customerid
}

Although I'm not sure if this is a good idea and how it should be implemented!!
9 years ago
Thank you all for your suggestions. But I'm not sure it can work for my situation .
Here is more info and the flow :
-----------------------------------
User accesses the webapp and tries to add an item to the customer.
Servlet-1 does
if(number of items for the customer in DB == 0)
{
allowAddingItem = true;
}
return allowAddingItem flag to user

User sees allowAddingItem is ture and submit the request to servlet-2 to increment the number of items


And here is the problem scenario.
-----------------------------------
Session 1
User-1 accesses the webapp and tries to add an item to customer-1
Servlet-1 does
if(number of items for customer-1 in DB == 0)
{
allowAddingItem = true;
}
return allowAddingItem flag to user
User-1 sees the result and WAITS.
At this time User-2 starts the session-2, and tries to add an item to customer-1
Servlet-1 does
if(number of items for customer-1 in DB == 0)
{
allowAddingItem = true;
}
return allowAddingItem flag to user

Now both users have allowAddingItem flag = ture on their screen and submit the request to servlet-2 to increment the number of items.

Notes :
-I can't add the check in servlet-2 as it is a thrid party app that I can't change.
-The only place I can make any changes is in Servlet-1.
9 years ago
Hi
Part of a web application function is to add an item to a customer object.
Some customer only can have one item. The application checks if the customer already has an item and if so it prevents adding more items.
if the check is passed system does other stuff and at the end it increases the number of item for that customer.

The problem is; if there are two sessions started simultaneously and both try to put an item on the same customer, they can get around this check.
In the first session, the check is performed and is passed. In the other session the check is performed and and is passed as well. At the end of each sessions, the customer end up with 2 items(stored in DB).

How can I solve this issue without keeping a track on the account by for example storing a temporary flag in DB indicting this customer is locked and any other session check for this flag.
Maybe synchronizing the Customer object throughout a session? but that would be too resource expensive

Any ideas ?


Thanks
9 years ago
Hi
any suggestion on what performance tool I should be using for webservice performance/scalability testing ?(mainly to get timing metrics of the response)

Thanks
Ross
9 years ago
Hi
I have a web service deployed on weblogic 920.
I've generated the ws client jar file using ant task clientgen . From eclipse I'm running the client against this webservice.
Can anyone please show me how to print the SOAP request and response in eclipse output console?


Thank you
Ross
9 years ago