tom chansky

Greenhorn
+ Follow
since Nov 01, 2004
Merit badge: grant badges
For More
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 tom chansky

thank you for the solution. I think that select query would be very helpful.
Does anyone know how to use JDBC to programmatically check if triggers are enabled in a SQL Server database?
well, i finally found out what the problem was. the following was the problem:

"firstName.toLowerCase()"

i didn't assign a String variable to hold the returned value from the above String function, so i never really passed "john" to the query; instead i kept passing "John" to it. Because of that side effect, the query always returned me an empty List!

mystery resolved!
15 years ago
i tried the following 2 queries, and they worked, EJB3Unit was able to return results:

@NamedQuery(name = "findTest", query = "select c from Client c JOIN c.names n")

@NamedQuery(name = "findTest", query = "select c from Client c JOIN c.names n where lower(n.firstName) like '%r%' and lower(n.lastName) like '%p%'")

But when I tried the following, EJB3Unit returned me an empty list:

@NamedQuery(name = "findTest", query = "select c from Client c JOIN c.names n where lower(n.firstName) like :firstName and lower(n.lastName) like :lastName")

:firstName was passed via "query.setParameter("firtName", "%" + firstName.toLowerCase() + "%")", and so was :lastName.

so, somehow the parameters cause some strange problems.
15 years ago
Actually, I should correct the last statement I said. "With JOIN objects/tables it returns an empty List".
15 years ago
The problem occurs in JOIN objects/tables. If I've a Select query that involves only one object/table, then EJB3Unit has no problem with it, and it will return me results. With JOIN tables/objects it returns null.
15 years ago
I just tried EJB3Unit-1.2 for my session bean. It works fine if the entity beans inside the session bean has declared NamedQueries.

But, when I have an operation (i.e. findByName(String firstName, String lastName)) inside the same session bean that uses dynamic query such as the following:

SELECT c FROM Client c JOIN c.names n WHERE lower(n.firstName) like :firstName AND lower(n.lastName) like :lastName

EJB3Unit for some strange reasons cannot return any results from the query!!

Does anyone ever have problems with dynamic queries with JOIN tables?
15 years ago
I'm new to EJB3. If I've a stateless session bean like the following:

@Local
public interface Cart {
...
}

@Stateless
public class CartBean implements Cart {
....
}

and I package this EJB bean in an EAR file, and then deploy the EAR in an application server. So, if I've a different web application also deployed in the same server, and want to access to that EJB3 bean inside that EAR file, how do I do that?

I understand that the EJB3 bean is exposed as a MBean, right? So, I should be able to access to that EJB3 bean via InitialContext.lookup(), correct? Or, should use I use something else?
1) platforms: linux and tomcat-5.5. 20
2) I set the following option in $CATALINA_HOME/bin/catalina.sh:

CATALINA_OPTS="-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=9004 \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false"

3) I've also checked if port 9004 is listening using "netstat -l -t -n -p".

I can monitor tomcat locally using jconsole without any issues. BUT, when I tried to do that remotely from a different machine via "jconsole myhost:9004", it failed to connect.

I also tried to telnet to myhost:9004, and that didn't work either. My firewall is not running. So, is there something that I'm missing???
17 years ago
If a Timer class is scheduled to perform a certain task repeatedly, and when a scheduled task is finished, who will clean up or terminate or stop that thread? Is there anything that I can do to make sure those finished threads are cleaned up so that they will not occupy resources.
I use the jaxws2.0 wsimport to generate a ws client.

So, When a ws client passes a pojo to a ws provider, does the ws client internally serialize the pojo using JAXB to marshall that object to xml before sending it to the ws provider?

If that's the case, does the provider use JAXB to unmarshall the xml back to a pojo?
17 years ago
I need to find a Java application for sending text to pagers. Is there such a thing available in the Java world? I serached google but I couldn't find anything.
17 years ago
Does anyone know where I can find a java api for the SNPP protocol? I need that api to communicate with Hylafax sever for paging.
i try to implement the ConnectionListener and TransportListener,and wonder what part of that EventQueue class plays in MailEvent, TransportEvent, and ConnectionEvent.
17 years ago
I can find the "javax.mail.EventQueue" binary class in the mail.jar(version 1.4), but I don't see it menetioned in the javadoc. Does anyone know where I can find the javadoc for that class?
17 years ago