1 Reply Latest reply on Jun 27, 2005 8:41 PM by Elias Ross

    XADataSource in Jboss with Sql Server

    Gopi Krishna Newbie

      Hi Everybody,

      I am new to this forum and I would like to seek an help regarding the JBOSS 4.x XAdatasource when connecting to sql server 2000.

      I am able to look up the jndi, but getting connection timed out. I am using Inet Merlia sql driver. The following is the code snippet

      <xa-datasource-property name="ServerName">IPAddress</xa-datasource-property>
      <xa-datasource-property name="DatabaseName">DBName</xa-datasource-property>
      <xa-datasource-property name="SelectMethod">cursor</xa-datasource-property>
      <!-- not sure if these should be here-->

      I changed the deafultDS names and corresponding stadardjbosscmp-jdbc.xml and other xml also.

      The following is the code snippet:
      public abstract class XAEjbBean implements javax.ejb.SessionBean {

      private SessionContext context;
      private Connection con;
      private PreparedStatement pr;
      private String dbName = "java:/XATdsSample";
      * @ejb.interface-method
      * view-type="remote"
      public void getConnection(){
      if (con != null) return;
      InitialContext ic;
      ic = new InitialContext();
      DataSource ds = null;
      ds = (DataSource)ic.lookup( dbName );
      con = ds.getConnection();
      // pr = con.prepareStatement("INSERT INTO #XATdsSample( id, name) VALUES( ?, ?)");
      }catch(NamingException ex){
      throw new EJBException( ex.getMessage() + "\nCheck the configuration of your application server. You need to add the datasource to the 'default.properties'" );
      }catch(Exception e){

      I am getting the following error -
      INFO [WrapperDataSourceService] Bound connection factory for resource adapter for Connection
      Manager 'jboss.jca:name=XATdsSample,service=DataSourceBinding to JNDI name 'java:XATdsSample'
      19:28:30,085 WARN [JBossManagedConnectionPool] Unable to fill pool
      org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLE
      xception: [TDS Driver]Too many connections :3)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(Loc
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListene
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.fillToMin(InternalManagedCon
      at org.jboss.resource.connectionmanager.PoolFiller.run(PoolFiller.java:70)
      at java.lang.Thread.run(Thread.java:534)
      Caused by: java.sql.SQLException: [TDS Driver]Too many connections :3
      at com.inet.tds.TdsDriver.a(Unknown Source)
      at com.inet.tds.a.(Unknown Source)
      at com.inet.tds.r.a(Unknown Source)
      at com.inet.tds.TdsDriver.connect(Unknown Source)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(Loc
      ... 4 more

      I apprepriate your responses. Thanks in advance
      Gopi Krishna