Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2011
    Posts
    4

    Unanswered: Missing Inserted DAta rows..need help!!!

    Hello folks,

    i am currently having an issue with my data not getting persisted properly.

    Basically with the code below i am able to insert rows into my table, but the data disappears after few hours. I have no clue why this is happening. Any insight will be appreciated. thank you for ur time.

    Code:
     String SQLIns = "insert into xyx values ...";
    
                    String connectionstring = "ConnectionString";
                    OracleConnection conn = new OracleConnection(connectionstring);
                    conn.Open();
                    OracleCommand DbCommand = conn.CreateCommand();
                    DbCommand.CommandText = SQLIns;
                    DbCommand.ExecuteNonQuery();
                    DbCommand.Dispose(); 
                    conn.Close();
    Last edited by tech_nerd; 12-13-11 at 13:14.

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    I don't see a commit in that code. Are you committing your changes properly?

    If they are intially there and then disappear "after a few hours" apprently some other program is deleting the data. Rows in a table don't just vanish

  3. #3
    Join Date
    Dec 2011
    Posts
    4
    nope i am not commiting the insert. shud'nt i commit only if i use a transaction based sql insert in my code ?

    This code is working, but the data jus disappears after few hours. And i am so struck...

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    COMMIT make DML changes permanent.
    without COMMIT other sessions can not see changed data
    & DML changes are subject to ROLLBACK
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Dec 2011
    Posts
    4
    Quote Originally Posted by anacedent View Post
    COMMIT make DML changes permanent.
    without COMMIT other sessions can not see changed data
    & DML changes are subject to ROLLBACK
    ok did this..i will let u know how this goes..thank u

  6. #6
    Join Date
    Dec 2011
    Posts
    4
    Quote Originally Posted by anacedent View Post
    COMMIT make DML changes permanent.
    without COMMIT other sessions can not see changed data
    & DML changes are subject to ROLLBACK
    ok, tried commiting the data. Again the data vanished overnight. Is there some kind of server setting that might be triggering this data loss.

    Also planning on enabling logging for this table and see what making this data disappear...

    again, any suggestions/recommendation is welcomed. thank you.

  7. #7
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    someone or a scheduled process is removing the data. Oracle will never automatically remove rows
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  8. #8
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    If you are using a database / schema that is daily overwritten by its "backup" copy (for example, a schema used by students or a testing database or similar), maybe that's why you are losing your data.

  9. #9
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Again the data vanished overnight.
    DBMS_LOGMNR can tell when & which process changed the data.
    If you knew these 2 details, you might get closer to the root cause.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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