Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

agam agam

Greenhorn
+ Follow
since Jul 28, 2003
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 agam agam

hi.

where i can download weblogic server 6.0 for linux/win.
i have tried to bea.com, and i can't find it.

thank's for the answer

aga,
17 years ago
hi, i'm new in JMS and MDB,
I have a problem working with MDB.
I have a batch to generate report,this batch is a thread, if it done
to generate report it will sleep for a few time. To Generate report
this thread call the SessionBean, so exactly report is generate by Session bean, thread just a caller.
than I have an idea to use MDB rather than using thread, the Idea is:
1. I put initial message to queue, than i set the queue so it
will be view the message to MDB in some period, EG: 5 minutes
2. MDB will aware this message(asynchronous) and call session bean, same as
the tread do, to generate report.
3. After generate report is finish, MDB will Put a message to queue again.
I use command pattern so i just cut and paste existing code in the thread to
MDB, logically it not to be a problem, but in reality it has.
I'm using weblogic 8.1 and here is the code:
ALTERNATIF 1:
try{
ctx = new InitialContext();
CommandServerLocalHome commandServerLocalHome = (CommandServerLocalHome)ctx.lookup("CommandServerBeanLocal");
CommandServerLocal cmd = commandServerLocalHome.create();
ProcessBatchCommand batch = new ProcessBatchCommand();
cmd.executeCommand(batch);
}
catch(Exception e){
e.printStackTrace();
}
finally{
PushMessageToQueue.push("ekiosk-process-queue");
}
ALTERNATIF 2.
try{
PushMessageToQueue.push("ekiosk-report-queue");
}
catch(Exception e){
}
finally{
try{
ctx = new InitialContext();
(CommandServerLocalHome)ctx.lookup("CommandServerBeanLocal");
ProcessReportCommand batch = new ProcessReportCommand();
batch.execute();
}
catch(Exception e){
e.printStackTrace();
}
}