0 Replies Latest reply on Aug 14, 2003 1:14 PM by bm_nguyen

    datasource re-etablish and ExceptionSorter

    bm_nguyen

      Is there any way to avoid restart jboss when we bounce the database. (We use MS SQL-SERVER 97 with JBOSS 3.4)

      I read some threads in here and it seems that writing
      an ExceptionSorter for MS SQL-SERVER is the only way, but I dont know how to start and where to put the class in the config file. Out config file look like this:

      <!-- Datasource/Connection pooling setup for Gentran-Database-->


      <!-- Include a login module configuration named MSSQLDbRealm.
      Update your login-conf.xml, here is an example for a
      ConfiguredIdentityLoginModule:

      <application-policy name = "MSSQLDbRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
      <module-option name = "principal">yourprincipal</module-option>
      <module-option name = "userName">yourusername</module-option>
      <module-option name = "password">yourpassword</module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MSSQLDS</module-option>
      </login-module>

      </application-policy>

      NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
      module-option name = "managedConnectionFactoryName"
      must match the object name of the ConnectionManager you are configuring here.
      -->
      <!--uncomment out this line if you are using the MSSQLDbRealm above-->
      java:/jaas/MSSQLDbRealm_Gentran_Db
      <!-- -->

      <depends optional-attribute-name="ManagedConnectionFactoryName">
      <!--embedded mbean-->


      MSSQLDS_GENTRAN_DB



      <!--config-property name="ConnectionURL" type="java.lang.String">jdbc:odbc:DatabaseServer;database=GentranDatabase</config-property-->
      <!--config-property name="DriverClass" type="java.lang.String">sun.jdbc.odbc.JdbcOdbcDriver</config-property-->
      <config-property name="ConnectionURL" type="java.lang.String">jdbc:jtds:sqlserver://pompeii.gers.com:1433/GentranDatabase</config-property>
      <config-property name="DriverClass" type="java.lang.String">net.sourceforge.jtds.jdbc.Driver</config-property>

      <!--set these only if you want only default logins, not through JAAS-->
      <config-property name="UserName" type="java.lang.String">sa</config-property>





      <!--Below here are advanced properties -->
      <!--hack-->
      <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper

      <exception-sorter-class-name></exception-sorter-class-name>


      <depends optional-attribute-name="ManagedConnectionPool">
      <!--embedded mbean-->


      0
      10
      5000
      1
      <!--criteria indicates if Subject (from security domain) or app supplied
      parameters (such as from getConnection(user, pw)) are used to distinguish
      connections in the pool. Choices are
      ByContainerAndApplication (use both),
      ByContainer (use Subject),
      ByApplication (use app supplied params only),
      ByNothing (all connections are equivalent, usually if adapter supports
      reauthentication)-->
      ByContainer



      <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager

      <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager

      java:/TransactionManager
      <!--make the rar deploy! hack till better deployment-->
      jboss.jca:service=RARDeployer