Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Carlos Llona

+ Follow
since Apr 09, 2004
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 Carlos Llona


for instance Can I have this method signature in a component interface for a sateless??

public java.util.List getXXX(String s) {


I have a doubt because List doesn't extend Serializable. This method is correct or no corcerning the specification. I assume that there is no problem with that , but I need other opinions

thanks a lot
Hello I have this doubt

In the page 331 of HFEJB shows a little sample about the method ejbCreate of a CMP bean. I know that every ejbCreateXX method should return the type of its �rimary key (in this sample String). but why the return tupe is a null. I think it must be a the primary key generated???

Thanks a lot
Hello: can anybody help in that topic

I know that I have to narrow the home interface when I want to use acording to the specification laike this:

Context initialContext = new InitialContext();
CartHome cartHome = (CartHome)javax.rmi.PortableRemoteObject.narrow(
initialContext.lookup(“java:comp/env/ejb/cart” ,

But what happend when in a session I invoke a method of a entity that return a collecion of bean? do I have to use portableremoteObject() or a simple cast?

And what happend whith the findByPrimeryKey that return the component interface remote. I never use portableremoteObject, do I should???

Thanks!! a lot

I'm very happy yesterday I took the exam and passed with 90%, the exam is easier than the HFEJB's mock, Thanks Kathy, Bert and all the people in javaranch

16 years ago

What happend if in one method running in CMT I set the transaction to rollback (mycontext.setRollbackOnly())

will the container throws a Exception to the client when the method finish(or the method who colled)???

thanks alex.

but, I think that this is a bad tecnique/practice because I would cach all exception (java.lang.Exception) in my method to rolledback the transaction, and every one knows that this is a very bad practice.

What do you think about that?

I have this doubt about roll back transaction;

If I have a method in a bean (MDB or session) with CMT, If the method throws a system Exception the transaction is automaticaly rolled back. (Supose that the method have a transaction)

But what happend if I have that bean with BMT, If the method throws a system exception the transaction is rolled back automaticaly or I have to rolled back???


does anybody know witch methods (Entity bean) run in the transaction context of the method that causes their invocations???

I know that ejbSelect method performs like that type, other?

thanks a lot


In the pass, I took other java exam (SCJP and SCWCD), before the real question I had to answerd questions about each exam's objective, its about my level of each objective. My question is: does the difficulty increase or decrease depending the answerds I choose??

thanks a lot Carlos
Hello helppp:

the spec says in 11.2.2

Select methods?Select methods are a special type of query method not directly exposed
through the client view. The Bean Provider typically uses select methods to select the persistent
state of an entity object or to select entities that are related to the entity bean for which the
query is defined. The result type of a select method can be an EJBLocalObject (or a collection
of EJBLocalObjects), an EJBObject (or a collection of EJBObjects), or a cmp-field value (or a
collection of such).

I think that the results should be EJBlocalObjects or collecions or cmp-field value (or a collection of such). Why does the result will be ejbObject (remotes) is it right?, In witch cases it would be objects remotes???

sorry my inglish is poor
thanks Valentin! but

then, Distinc eliminates my entities repeated? if my query bring me for example the player with the primary key="00001" 5 times. with distinc I will only recive 1 record. is that right?


are there any different for example if I do this?:
FROM Player p


FROM Player p

In my database sample there are only 10 records. I suposse that the two queries always bring me 10 records. I dont imagine in what case (maybe using the clouse where) I could get a record repeated.

can you give me one sample plz

thanks a lot


I have a doubt about the clause DISTINCT, I dont understand what exactly does!!!.

What criteria does distinct uses to determine what object is repited?


FROM Player p

in this example what does distinct serch to determinate if one object is repeated? it searches all the fields??? except primary keys or what?javascript: x()

I expect that all opf you understand the question, if no, please show an example of distinct and exactly what things it does.

thanks a lot

Sorry Vitaliy

I make a huge mistake, I use WSAD for running my beans. when I put a method in my component interface websphere shows me a warning that says something like that "the specifications says that all objects must implements Serializable". I thought that I coudn't deploy my beans, but I just made the test and all works fine , I suposse that the warning appears because Collecion doesn't implements Serializable.

Now it's all clear

And thanks a lot

Thnaks a Lot

Then, is it possible use the java.util.Collection (or java.util.List) as a return type in one method of my component interface??

When I use java.util.Vector or java.util.ArrayList, everything is ok, but When I use java.util.Collection or java.util.List I've got a message saying that I can't use these interfaces.

Carlos Llona
Hello, Sorry my english is poor but I try to explain.

In page 133 of HFEJB show us the "rules for the component interface".
And say that my method's arguments and return types must be serializabbe.....and collections of any of those.

what does it mean with collections?

Its about the interface java.util.Collection or his sons like Vector, ArrayList.

My doubt is because Collection not implemets Serializable and only some of his sons implements Serializable Like a Vector, but List dosn't.

I can have a method wiht that signature in my component interface

public java.util.Collection obtainAll (String s) thorws remoteException;

thanks a lot!!!

Carlos Llona