Win a copy of Terraform in Action this week in the Cloud forum!

Agasthya Iyer

Greenhorn
+ Follow
since Sep 22, 2005
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 Agasthya Iyer

Hi There,

I changed my namedQuery to use named parameters like

select t.x, t.y from table t
where t.description = escription
and t.types in (:typesList)

Query query = session.getNamedQuery(queryName);
String[] paramNames = query.getNamedParameters();
if(args.length == paramNames.length) {
for(int i = 0; i < paramNames.length; i++) {
if(paramNames[i].endsWith("List")) {
query.setParameterList(paramNames[i], (List)args[i]);
}else {
query.setParameter(paramNames[i], args[i]);
}
}

where args is an Object[] of the values that I need to bind to the namedParameters in the order in which it is laid out in the Named Query
Hi There,

I am using a named query and in one of the where clause condition I need one or more values in the IN Clause like as follows:

select t.x, t.y from Table t
where t.date between ? and ?
and t.types in (one or more values based on user action).

Is there a way of accomplishing the above without using a Criteria API to build dynamic HQL.

Any help would be greatly appreciated.

Thanks and Regards,
Agasthya
Just read the Spec-Objectives mapping as mentioned in the link below
http://www.valoxo.ch/jr/cheatsheets.html.

HTH

Regards,
Agasthya
Just want to make sure you are using JDK1.3 and J2EE 1.3 RI

Best Regards,
Agasthya
Superb explanation. Thank you Peer.

Regards,
Agasthya
You might want to reboot the computer.
You can try adding a JAVA_HOME system variable by going to Control Panel-->System-->Advanced-->Environment variables-->System Variables-->New-->JAVA_HOME-->c:\j2sdk1.4.1\bin

HTH

Regards,
Agasthya
Yes I know that we can access the ejb thru the remote interface even if it is in the same container.

The question is How?? Does the container have to determine that it does not need to use serialization as all the processing is going to happen in the local heap and it can pass object references to method calls??

Best Regards,
Vish
Dear Ranchers,

My understanding is that eventhough the client that invokes the Bean is running in the same JVM it is good to expose the bean as remote as in future it would be helpful scaling it horizontally.

In the case of AdviceBean example, the AdviceClient is being invoked in the same JVM as the server in which the bean is deployed. So my question is when we do a PortableRemoteObject.narrow(o, AdvisorHome.class) which would generally return a reference to the stub of a component Interface, does the Container know when it did a JNDI lookup that it found the AdvisorBean locally and that it does not have to make remote calls and thereby instead of returning a reference to the stub of a Component Interface, returns a direct reference to the EJBObject??

Best Regards,
Agasthya
See errata

HTH

Regards.
Agasthya
Dear Mahela,

We will have to create the ejb-jar.xml ourselves. ejb-jar.xml will be created if you use an IDE to generate the beans. But since you must have created the ejbs urself you will have to create the ejb-jar.xml urself as well.

RI stands for Reference Implementation server.

See
errata[/URL] if you are getting a run time error like CORBA.BAD_OPERATION.

HTH

Regards,
Agasthya
Head First EJB is a good book for both learning the concepts and passing SCBCD.

HTH

Best Regards,
Agasthya
Dear Mannu,

Local component interfaces extend javax.ejb.EJBLocalObject. When the client calls create on the local home interface a reference to the Local component interface is returned back to the Client which the client uses to call business methods.

Was that helpful at all??

Best Regards,
Agasthya
Dear Sanneel,

Scenarios

i. You catch a checked exception in your ejbActivate method. The method is not in a transaction. (A. Throw an EJBException). Becuase the ejbActivate is a container callback method we cannot throw a checked exception from a method that does not declare the exception. The only thing we should throw from one of the container callbacks of SessionBean is an EJBException

ii. A DivideByZero exception occurs as your business logic is running. You do not have a try/catch for this. (D. Allow the exception to propagate(in other words, duck it).

iii. You throw a CreateException from your ejbCreate() method and you realize that you probably cannot safely complete your transaction (C. Invoke setRollbackOnly()

iv. You catch a checked exception in a business method, and realize that your bean is probably corrupt (C. Invoke setRollbackOnly())

HTH

Best Regards,
Agasthya Iyer