Results 1 to 4 of 4

Thread: Data Loss

  1. #1
    Join Date
    Jan 2003
    Posts
    3

    Unhappy Unanswered: Data Loss

    Hi All,
    I am having real trouble with DB2 v 7.0. We are using Websphere-DB2 on windows-2000 platform. I am definitely not an expert in db2. I am debugging application written by somebody else.
    Problem: Users of our website update/insert their information. If we have to restart the websphere for new build etc., db2 drops the data entered from last day or so. My guess is db tables are getting locked because of some database operations (concurrent requests), so data is not really committed to the database (but we can see the updated data immediately on the site before server restarts) and when we restart server, data is being dropped. Default JDBC autoCommit() is in place. So there are no exclusive ‘commit’ statements in the code.
    I desperately want to know what might be causing it and whether this is application problem or DB2 settings problem. I went thro’ DB2 documentation looking for how to reduce no. of locks and it suggests having frequent commits in the code. But there is no need to have commits exclusively, since autoCommit() is on. Also does just “select” statement put some kind of lock on the table?
    I will appreciate the help. Thanks.

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Data Loss

    If there is a lock on a table, data will not be updated and you application will wait indefinitely or upto LOCKTIMEOUT period ... If you are able to see data in your application after INSERT, it is because it has been inserted even if it is not commited.

    What do you mean by server restart ? Is it server crash ?

    Are you stopping the database and websphere in an elegant manner ie, are you stopping it forcefully (like force application or db2stop force. .. I don't know the equivalent in Websphere) ...

    Have a look at db2diag.log file ? Are there entries for crash recovery of the database ? Does it take too long ?

    Once the data is inserted into the database by Websphere, check the data from the Command line processor ... Also, check the db2cli.ini file ... It could have autocommit set to off ...

    HTH

    Cheers

    Sathyaram




    Originally posted by DeepBS
    Hi All,
    I am having real trouble with DB2 v 7.0. We are using Websphere-DB2 on windows-2000 platform. I am definitely not an expert in db2. I am debugging application written by somebody else.
    Problem: Users of our website update/insert their information. If we have to restart the websphere for new build etc., db2 drops the data entered from last day or so. My guess is db tables are getting locked because of some database operations (concurrent requests), so data is not really committed to the database (but we can see the updated data immediately on the site before server restarts) and when we restart server, data is being dropped. Default JDBC autoCommit() is in place. So there are no exclusive ‘commit’ statements in the code.
    I desperately want to know what might be causing it and whether this is application problem or DB2 settings problem. I went thro’ DB2 documentation looking for how to reduce no. of locks and it suggests having frequent commits in the code. But there is no need to have commits exclusively, since autoCommit() is on. Also does just “select” statement put some kind of lock on the table?
    I will appreciate the help. Thanks.

  3. #3
    Join Date
    Jan 2003
    Posts
    3

    Question Re: Data Loss

    Sathyaram;
    Thanks for the reply.
    Server is not crashing, but we are taking just Webshere server down for updates etc (not DB2), but since data is not committed, I guess it is loosing the data on websphere-DB2 disconnect.
    Now before I take the webshere down, what procedure should I follow so that DB2 does commit the uncommitted data? how do I do clean shutdown of DB2, so that it doesn't loose data?
    Since this is JDBC application autoCommit is handled thro' JDBC calls.
    Thanks.

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Data Loss

    COMMIT/ROLLBACK should be done by your application ...

    I'd suggest you to write a small prog and check whether JDBC AUTOCOMMIT really works for your database ... If not, have a look at why it isn't ?

    HTH

    Cheers

    Sathyaram

    Originally posted by DeepBS
    Sathyaram;
    Thanks for the reply.
    Server is not crashing, but we are taking just Webshere server down for updates etc (not DB2), but since data is not committed, I guess it is loosing the data on websphere-DB2 disconnect.
    Now before I take the webshere down, what procedure should I follow so that DB2 does commit the uncommitted data? how do I do clean shutdown of DB2, so that it doesn't loose data?
    Since this is JDBC application autoCommit is handled thro' JDBC calls.
    Thanks.

Posting Permissions

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