[JCA/JBoss] - JBoss Connection Pooling Problem With Unisys DMS-II JDBC Dri
by acastanheira2001
Hi, people.
I tried to configure a datasource using Unisys DMS-II Jdbc Driver. I wrote the configuration below:
<no-tx-datasource>
<jndi-name>DmsiiMyDB-DS</jndi-name>
<connection-url>jdbc:unisys:dmsql:Unisys.DMSII:resource=mydb;host=myHost;port=1111;</connection-url>
<driver-class>com.unisys.jdbc.dmsql.Driver</driver-class>
<user-name>MyUser</user-name>
MyPassword
<min-pool-size>1</min-pool-size>
<max-pool-size>3</max-pool-size>
<idle-timeout-minutes>1</idle-timeout-minutes>
</no-tx-datasource>
That????s the situation:
1) My application invokes the first connection to DMS-II database; JBoss opens this connection and the application works fine;
2) The application invokes the second and third connections, working fine;
3) When the application tries to invoke the connection again it fails;
4) At Unisys mainframe side the DMS-II query show 3 active connections.
My theory is: JBoss is not managing correctly connection pooling with DMS-II Jdbc Driver. Every time a connection is requested JBoss establish it with DMS-II Database and do not release it after use. When the number of requests reaches its maximum value new connections are refused and the old connection are not release for reuse.
I am use JBOSS 4.2.0-GA-SP2 , JDK 1.5.0.15 .
Can anybody help me???
Thanks !!!!
Andre
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4223804#4223804
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4223804
15 years, 9 months
[EJB 3.0] - Re: JNDI Issue - Deploying EJB3 using Eclipse to JBoss 5
by yetti
Okay, I'm about to drink a pint of windshield wiper fluid. If Peter or anyone else can help me, I'm forever grateful.
I have created a new standard Java project, named com.acmeco.serverapp.ftp.client, that sits next to the EJB3 app in my Eclipse workspace.
I have created a jndi.properties file in the build path that has the data Peter suggested (even though I'm already hardcoding this info in the class itself below).
I have created a new class in the default package called HelloClientPOJO.java. Here is the code:
import javax.naming.InitialContext;
| import javax.naming.Context;
| import javax.naming.NamingException;
| import java.util.Properties;
| import javax.rmi.PortableRemoteObject;
|
| import com.acmeco.serverapp.ftp.ejb3.*;
|
| public class HelloClientPOJO {
|
| FTPBean _ftpbean;
|
| public HelloClientPOJO(){
| try{
| Context jndiContext = getInitialContext();
| Object ref = jndiContext.lookup("com.acmeco.serverapp.ftp.ejb3.FTPBeanRemote");
| _ftpbean = (FTPBean)ref;
| }catch (javax.naming.NamingException ne){
| //nothing
| }
| }
|
| protected void sayHello() {
| _ftpbean.doWork();
| }
|
| public static void main(String [] args)
| {
| HelloClientPOJO helloClient= new HelloClientPOJO();
| helloClient.sayHello();
| }
|
| // developed for JBoss only. this is vender dependency
| public static Context getInitialContext( ) throws javax.naming.NamingException {
| Properties p = new Properties( );
| p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| p.put(Context.URL_PKG_PREFIXES, " org.jboss.naming:org.jnp.interfaces");
| p.put(Context.PROVIDER_URL, "jnp://localhost:1099");
| return new javax.naming.InitialContext(p);
| }
| }
|
Here is the error on the console when the POJO app runs:
Exception in thread "main" java.lang.NullPointerException
at HelloClientPOJO.sayHello(HelloClientPOJO.java:24)
at HelloClientPOJO.main(HelloClientPOJO.java:30)
I got this from this URL/tutorial:
http://biese.wordpress.com/2008/02/20/how-to-call-ejb3-from-jsp-servlet-a...
Neither the server nor the bean(s) have been changed, so my JBoss startup/deployment log and JNDI info is all the same as before. What am I doing wrong? What do I need to put into the content lookup to find the bean?
Please help! Once I get this working, I am going to write the world's most idiot proof Hello World for JBoss 5/EJB 3/Eclipse. I know a LOT of other people have/had problems with these issues. I want to end the confusion once and for all.
yetti
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4223795#4223795
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4223795
15 years, 9 months