8 Replies Latest reply on Dec 19, 2004 12:32 PM by Alexey Loubyansky

    JDBC Insert Data Not Commited

    Auzi Auzi Newbie


      I have an application that uses simple
      JDBC to work with the database.
      The application executes simple INSERT\SELECT
      statements, using prepared statements.
      I'm using a MS-Sql local-tx datasource to get
      the connection.
      For some reason the table I'm working with gets
      locked right after I perform an insert, and it is not
      freed, when I do a select after insert, the select
      My mssql-ds.xml file has the following:

      <jndi-name>MyDs</jndi-name> <connection-url>jdbc:microsoft:sqlserver://mypc:1433</connection-url>
      <connection-property name="DatabaseName">
      </connection-property> <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>

      My code uses the following:

      InitialContext ctx = InitialContextUtil.getContext();
      DataSource ds = (DataSource) ctx.lookup("MyDs");
      Connection con = ds.getConnection();

      I get no errors during execution, however, after the insert,
      every select on the same table either from within jboss or from
      MS query analayzer hangs (queries on other objects work ok).