> Hi all,
>
[quoted text clipped - 3 lines]
> evenry minute, the TaskManager instantiates an EJB which makes a connection
> to the database and brings a file name which then will be loaded.
When you say 'instantiate', do you really mean 'create', or do you mean 'call'?
See below for more questions...
> When I run
> the application, I log the time in which timer is executed, and I see that
> the timer executes every one minute for some time and then suddenly there is
> a delay of 4-5 minutes.Again the timer comes back to normal and executes for
> sometime, again delays for 5-6 minutes. This happens sometimes, or not at
> all.
You should add code to see when the timer starts it's work, and when it finishes.
If the timer doesn't start it's work sometimes for 6 minutes, it's a different
problem than if the timer always starts, but sometimes doesn't finish for 6 minutes.
> What I am presuming is that when EJB is making a database connection using
> connection pool (we use WebLogic) , at a particluar time, EJB is not able to
> make a connection since all other connections may be in use and so waits for
> the next connection to be released.
Typically weblogic does not let a requestor wait indefinitely for a pool connection.
If the pool is fully used, a thread will typically wait no longer than 5 seconds. After
that time, the requestor usually gets a ResourceException.
> So by increasing the number of connections and no of EJBs will the problem
> be solved, please advise and thanks a lot for your time.
If you build your pool to have one connection for every execute-thread in the server,
that is usually enough.
If you find the server not running the timer code, or stuck running the timer code
you should get a full server stacktrace to let us see what the server is doing.
Joe Weinstein at BEA
> Best regards,
> Suja
Ravi Shankar - 21 Jun 2004 15:08 GMT
Hi Joe Weinstein,
Thanks for the reply.
To clarify:
The timer starting time is delayed for some 4-5 minutes. It is not that
timer is started and taking more time to finish.For example I am attaching
the logs:
2004-06-21 18:08:59,665 DEBUG com.transeta.thb.util.ThubLogger -
2004-06-21 18:08:59,665 DEBUG com.transeta.thb.util.ThubLogger - TaskManager
: Starting the ThubTaskManagerSession Bean Invocation at : 5/21/2004 18:8:59
2004-06-21 18:08:59,665 DEBUG com.transeta.thb.util.ThubLogger - TaskManager
: Ending the ThubTaskManagerSession Bean Invocation at : 5/21/2004 18:8:59
2004-06-21 18:08:59,666 DEBUG com.transeta.thb.util.ThubLogger -
2004-06-21 18:09:59,665 DEBUG com.transeta.thb.util.ThubLogger -
2004-06-21 18:09:59,666 DEBUG com.transeta.thb.util.ThubLogger - TaskManager
: Starting the ThubTaskManagerSession Bean Invocation at : 5/21/2004 18:9:59
2004-06-21 18:09:59,666 DEBUG com.transeta.thb.util.ThubLogger - TaskManager
: Ending the ThubTaskManagerSession Bean Invocation at : 5/21/2004 18:9:59
2004-06-21 18:09:59,666 DEBUG com.transeta.thb.util.ThubLogger -
2004-06-21 18:10:59,665 DEBUG com.transeta.thb.util.ThubLogger -
2004-06-21 18:10:59,665 DEBUG com.transeta.thb.util.ThubLogger - TaskManager
: Starting the ThubTaskManagerSession Bean Invocation at : 5/21/2004
18:10:59
2004-06-21 18:10:59,666 DEBUG com.transeta.thb.util.ThubLogger - TaskManager
: Ending the ThubTaskManagerSession Bean Invocation at : 5/21/2004 18:10:59
2004-06-21 18:10:59,666 DEBUG com.transeta.thb.util.ThubLogger -
2004-06-21 18:11:59,665 DEBUG com.transeta.thb.util.ThubLogger -
2004-06-21 18:16:59,666 DEBUG com.transeta.thb.util.ThubLogger - TaskManager
: Starting the ThubTaskManagerSession Bean Invocation at : 5/21/2004
18:16:59
2004-06-21 18:16:59,666 DEBUG com.transeta.thb.util.ThubLogger - TaskManager
: Ending the ThubTaskManagerSession Bean Invocation at : 5/21/2004 18:16:59
PLEASE SEE THE LAST TWO LINES, 18.16 means there is a gap of five minutes.
Any clue please, thanks a lot.
Best regards,
Ravi
> > Hi all,
> >
[quoted text clipped - 43 lines]
> This message was checked by NOD32 Antivirus System.
> http://www.nod32.com
Joe Weinstein - 21 Jun 2004 15:45 GMT
> Hi Joe Weinstein,
>
[quoted text clipped - 4 lines]
> The timer starting time is delayed for some 4-5 minutes. It is not that
> timer is started and taking more time to finish.
> One more clue. I just wrote a System.out.println in the EJB instead of
making a connection to the database. The logs are perfect, I mean every one
minute, no discrepancies.
I don't completely understand... If the EJB is called by the timer, how can the
EJB get called every minute, but the timer get delayed?
In any case, if the timer is getting delayed, it sounds like a problem
with the timer.
When the timer is delayed, are you sure the previous timer had finished
it's work within the minute before the next one was supposed to start?
If so, this seems like a JVM/timer problem, nothing to do with JDBC or the DBMS...
Joe Weinstein at BEA
For example I am attaching
> the logs:
>
[quoted text clipped - 134 lines]
>>This message was checked by NOD32 Antivirus System.
>>http://www.nod32.com
Ravi Shankar - 21 Jun 2004 15:27 GMT
Hi Jon,
One more clue. I just wrote a System.out.println in the EJB instead of
making a connection to the database. The logs are perfect, I mean every one
minute, no discrepancies.
Can we conclude anything, thanks
Best Regards,
Ravi
> > Hi all,
> >
[quoted text clipped - 43 lines]
> This message was checked by NOD32 Antivirus System.
> http://www.nod32.com
Roedy Green - 21 Jun 2004 17:13 GMT
>One more clue. I just wrote a System.out.println in the EJB instead of
>making a connection to the database. The logs are perfect, I mean every one
>minute, no discrepancies.
>
>Can we conclude anything, thanks
Your timer spawns some task on cue. For some reason that task is
stalling.

Signature
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.