Results 1 to 5 of 5

Thread: Retrieve after roll back

  1. #1
    Contributing Member
    Join Date
    Apr 2007
    Answers
    41

    Retrieve after roll back

    I have a doubt...

    Here goes

    If i add a row to a table, and wont use the command commit.
    When i delete that particular row, and use roll back will i be able to retrive it?

    Actually I need explanation abt working of roll backk?


  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Retrieve after roll back

    Your question is really intresting.

    But you will not be able to retrive that record.
    Actually tilll u commit the transactions are stored in memory not in actual database table. when u delete it is deleted from there.
    So no chance of tetriving it back.


  3. #3
    Contributing Member
    Join Date
    Jul 2007
    Answers
    42

    Re: Retrieve after roll back

    u will not get datas because u have not use commit for insert rows so u have used rollback that time full session rollback or after commit.
    so hence use savepoint.


  4. #4
    Contributing Member
    Join Date
    Sep 2007
    Answers
    35

    Re: Retrieve after roll back

    hello prakash,

    without commiting, the inserted row is not saved in the database,just it is stored in the memory.
    here is the example.

    SAVEPOINT S1;
    UPDATE STMT..
    create STMT.
    SAVEPOINT S2;
    INSERT
    ROLLBACK TO S1;

    For the above sequence first one savepoint is created s1. next update is done.next create stmt(ddl stmt)
    another savepoint s2 is created.
    after this insert the row.

    1)when we r giving rollback to s1.
    upto the savepoint s1 it will roll back.
    creating the save point means,just we r giving conformation of transactions(dml stmts) which r done before savepoint.

    2) another is we have done some set of transactions(dml stmts), after this if we give any ddl command(create alter drop)
    our transactions before this ddl stmts are automatically get commited.


  5. #5
    Junior Member
    Join Date
    Jan 2008
    Answers
    24

    Re: Retrieve after roll back

    if we have performed a DML operation either we have to use commit or we have to perform DDL operation else the changes can not be made in database.It appears to u that is there but others clients can not view this until there is a change made in database.As there is no change to data in database u r not able to retrieve it using rollback

    Last edited by chaitueeturi; 01-23-2008 at 01:54 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact