Thread: Toplink does not return the object sometimes - VeryHigh Volume application

This question is not answered. Helpful answers available: 5. Correct answers available: 1.


Permlink Replies: 10 - Pages: 1 - Last Post: Jun 8, 2009 5:41 PM Last Post By: Raam
Raam

Posts: 78
Registered: 12/14/06
Toplink does not return the object sometimes - VeryHigh Volume application
Posted: Jun 4, 2009 4:40 PM
 
Click to report abuse...   Click to reply to this thread Reply
Hi All,

Toplink version: 10.1.3.4, OAS 10.1.3.4, Oracle 10g, RedHat linux 4.0

We have a high volume application where toplink issues one of our queries like 25K times/hour.Query is a simple one querying the table based on the primary key(Id) that should return 1 object.

This query is not returning the object sometimes I should say like 200 times/hour. What bothers me is that the same query on the same Id(primary-key) returns the object another time.

I did enable the toplink logging level to FINE where I could see the SQL query getting issued to the DB, I was unsuccessful in changing the logging level to ALL to check if the object is getting returned by the toplink layer and being registered in the cache kind of details.

This is not easily re-producable as this only occurs in our Pre-Prod environment where we can simulate high volume. This completely baffles me and I am running out of ideas.

Thanks in advance.

-Ram

Edited by: Raam on Jun 4, 2009 7:41 PM
Gordon Yorke

Posts: 427
Registered: 06/21/02
Re: Toplink does not return the object sometimes - VeryHigh Volume application
Posted: Jun 5, 2009 6:02 AM   in response to: Raam in response to: Raam
 
Click to report abuse...   Click to reply to this thread Reply
TopLink's most verbose logging level is FINEST. Is the object ever removed from the database? What are the cache settings for this entity class? Is this object ever modified by the application? Are you using a UnitOfWork or session to execute the query?
--Gordon
SebTardif

Posts: 229
Registered: 04/04/06
Re: Toplink does not return the object sometimes - VeryHigh Volume application
Posted: Jun 6, 2009 7:25 AM   in response to: Raam in response to: Raam
 
Click to report abuse...   Click to reply to this thread Reply
We did had a different concurrency issue with TopLink in the past because TopLink was not thread-safe. What we did, in our application layer encapsulating TopLink API, is to retry 3 times when the unexpected was occuring. In our situation, trying 3 times was good enough to fix all issues.
Raam

Posts: 78
Registered: 12/14/06
Re: Toplink does not return the object sometimes - VeryHigh Volume application
Posted: Jun 6, 2009 4:13 PM   in response to: SebTardif in response to: SebTardif
 
Click to report abuse...   Click to reply to this thread Reply
I have plans to put the re-try logic in there and see the results, I will update the thread accordingly.

Thanks for the inputs though, appreciate it.

-Ram
Raam

Posts: 78
Registered: 12/14/06
Re: Toplink does not return the object sometimes - VeryHigh Volume application
Posted: Jun 6, 2009 4:15 PM   in response to: Gordon Yorke in response to: Gordon Yorke
 
Click to report abuse...   Click to reply to this thread Reply
I tried with the FINEST level but due to the volume of the application, my system crashes doing the logging.

Object is never removed from the DB but being updated by other threads.

Using UnitOfWork to execute the query, cache setting is Isolated cache.

-Ram
Gordon Yorke

Posts: 427
Registered: 06/21/02
Re: Toplink does not return the object sometimes - VeryHigh Volume application
Posted: Jun 8, 2009 6:13 AM   in response to: Raam in response to: Raam
 
Click to report abuse...   Click to reply to this thread Reply
You are using only 1 thread per UnitOfWork? and you are not reusing UnitofWorks
--Gordon
Raam

Posts: 78
Registered: 12/14/06
Re: Toplink does not return the object sometimes - VeryHigh Volume application
Posted: Jun 8, 2009 7:35 AM   in response to: Gordon Yorke in response to: Gordon Yorke
 
Click to report abuse...   Click to reply to this thread Reply
We are not re-using UOW.
One UOW per thread.

-Raam
Gordon Yorke

Posts: 427
Registered: 06/21/02
Re: Toplink does not return the object sometimes - VeryHigh Volume application
Posted: Jun 8, 2009 11:04 AM   in response to: Raam in response to: Raam
 
Click to report abuse...   Click to reply to this thread Reply
If you are configured for an isolated cache then there should be no concurrency issues. Each thread will query the database directly and load the object into the UnitOfWork. Is there an Exception handler configured on TopLink? Are you getting a timeout exception or some other exception that is being ignored?
--Gordon
Raam

Posts: 78
Registered: 12/14/06
Re: Toplink does not return the object sometimes - VeryHigh Volume application
Posted: Jun 8, 2009 12:08 PM   in response to: Gordon Yorke in response to: Gordon Yorke
 
Click to report abuse...   Click to reply to this thread Reply
We have an exception handler attached to toplink and no exception is being caught or ignored.
Like I said the same query gets executed after 3 or 4 secs and I can get the object back.

-Raam
Gordon Yorke

Posts: 427
Registered: 06/21/02
Re: Toplink does not return the object sometimes - VeryHigh Volume application
Posted: Jun 8, 2009 12:10 PM   in response to: Raam in response to: Raam
 
Click to report abuse...   Click to reply to this thread Reply
Does your exception handler rethrow exceptions? There was a doc bug in the TopLink docs at one point that did not show the customer handler rethrowing the exception. The handler must rethrow the exception or the exception will be "swallowed".
--Gordon
Raam

Posts: 78
Registered: 12/14/06
Re: Toplink does not return the object sometimes - VeryHigh Volume application
Posted: Jun 8, 2009 5:41 PM   in response to: Gordon Yorke in response to: Gordon Yorke
 
Click to report abuse...   Click to reply to this thread Reply
Our exception handler logs and re-throws the exception.

-Raam
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums