Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003

    Exclamation Unanswered: Java program not able to insert in table in transactional database


    I am having problems while trying to insert values inside a table when the database has transactional logging enabled.

    I created the database thus:
    "create database dbname with log mode ansi"

    Next I created a table thus:
    "create table tablename(col1 as char(10))"

    When I use a test java program to insert values into this table, I am getting error -271("Could not insert new row into the table.")

    I am attaching the Java program as well as the log in the zip file. The Java program makes use of a number of methods in DatabaseMetaData and Connection interface of java.sql package to give an idea of the environment I am working on.

    > Informix Dynamic Server 9.3
    > Win2k Server
    > JDBC driver version 2.30.JC1N814

    Thanks for all the help,
    Attached Files Attached Files

  2. #2
    Join Date
    Aug 2002
    The isam error tells you the exact cause of the
    problem ("the file is locked...").

    Are you running this program concurrently or is another
    program trying to change (insert, update, delete or select)
    the same rows ?

    You should create your table with row-level-locking
    not page-level-locking, i.e.:

    create table tablename(col1 as char(10)) lock mode row;

    And perform the statement 'set lock mode to wait 5' in your
    jdbc program.
    This should help to avoit the problem.

    Be careful with mode-ansi-databases. You have automatically
    the default isolation level of 'repeatable read'. This is in
    most cases not what you want. So you should either change
    the isolation level to committed read or cursor stability or
    you should normal 'unbuffered' databases, but not mode-ansi (create database <db> with log).

    Best regards

    IT-Consulting Herber

    Download the IFMX Database-Monitor for free at:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts