If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Missing Inserted DAta rows..need help!!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-13-11, 11:54
tech_nerd tech_nerd is offline
Registered User
 
Join Date: Dec 2011
Posts: 4
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 12:14.
Reply With Quote
  #2 (permalink)  
Old 12-13-11, 11:58
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,408
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
Reply With Quote
  #3 (permalink)  
Old 12-13-11, 12:13
tech_nerd tech_nerd is offline
Registered User
 
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...
Reply With Quote
  #4 (permalink)  
Old 12-13-11, 12:34
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 6,416
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.
Reply With Quote
  #5 (permalink)  
Old 12-13-11, 14:51
tech_nerd tech_nerd is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 12-16-11, 08:16
tech_nerd tech_nerd is offline
Registered User
 
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.
Reply With Quote
  #7 (permalink)  
Old 12-16-11, 08:38
beilstwh beilstwh is offline
Lead Application Develope
 
Join Date: Jun 2004
Location: Liverpool, NY USA
Posts: 2,222
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.
Reply With Quote
  #8 (permalink)  
Old 12-16-11, 11:18
Littlefoot Littlefoot is offline
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,629
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.
Reply With Quote
  #9 (permalink)  
Old 12-16-11, 20:20
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 6,416
>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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On