Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"

Abhijeet Nalawade

+ Follow
since Apr 01, 2007
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Abhijeet Nalawade

Hary, could you let us know the java version you are using.

9 years ago

But in this case if i use CMT and if i throw exception from updateUserTable3() method this transaction will be rolled back... am i right? m just confused.... So in this case rollback be acheived by CMT?!

First correction we are using BMT and not CMT. If exception is thrown in any of the 3 update table method the whole transaction from start to end will be rolled back.

if i use setRollbackonly if exception is thrown would this rollback the transaction?

For BMT the UserTransaction.setRollbackonly API will execute all the code block between transaction start to end even when Tx fails in between. Thread on setRollBackOnly

In this case i am not at all using Entity bean. I am updating 3 table in single EO method. e.g. UpdateProfile. i.e. i am invoking 3 dao methods from updateProfile EO method.
Now in this case if call to update first two table is successful but if method call to update 3rd table fails i.e. 3rd DAO method fails i want rollback the whole transaction.
i.e i want to rollback the database updates to keep database in consistent state.
When one of the database update fails i am throwing application specific exception.

Can this database rollback be achieved using CMT? Please advise me how to do this without using entity beans.

Can be done by Bean managed Transactions
For eg.

Can you implement small modification to class CalcSever

//Code to Replace

//New Code

I tried the same locally it worked, hope the same is the case with you too.
9 years ago
Question raised in Certification forum with valid answer here
9 years ago

If your problem is not solved could you please do a few amendments to your code.

//OpFunction interface modifications
String REGISTRY_NAME = "//localhost:1099/OpFunction";
int REGISTRY_PORT = 1099;

//Server, main() modifications

//Client, method modifications

Let me know if you face any further problems.
9 years ago

Can you let me know the contents fetched from location http://localhost:8080/ CalcServer.

3) ---->java -Djava.rmi.server.codebase=http://localhost:8080/ CalcServer

The codebase property should return the jars/classes files which are downloaded to client system on remote object lookup.

9 years ago
By using "List<? super Integer>" in our type declaration of list, we include only elements who are either of type Integer or elements for whom Integer is super class.
Fail to understand what is to be achieved. Explain it bit more clearly.
10 years ago
Hi Andreas

The join method is called on instance of a thread object.
For your reference check the API

I dont know the actual solution. Just check out if this helps you.
10 years ago
Replace the code loading the file with this snippet.
10 years ago
No..class cannot be Synchronized. We can have synchronized blocks or methods.
Yes we can add scrollpane to panel.
10 years ago
<jsp:forward> element forwards the request object containing the client request information from one JSP file to another file.

The forward method of RequestDispatcher will forward the ServletRequest and ServletResponse that it is passed to the path that was specified in getRequestDispatcher(String path). This method is useful for communicating between server resources, (servlet to servlet).
10 years ago