PHPFan
PHPFan

Reputation: 796

DeleteRecordStore error: record store is still open

I have a simple problem.

I want to delete a recordStore data.

when I execute the deletion code

I get this error message

javax.microedition.rms.RecordStoreException: deleteRecordStore error: record store is still open at

javax.microedition.rms.RecordStore.deleteRecordStore()

    try
    {

    recordStore2.closeRecordStore() ;

    }

    catch(Exception e)

    {

    e.printStackTrace();

    }


   try

   {

   recordStore2.deleteRecordStore("recordStore2");

  }

   catch(Exception e)
   {

   e.printStackTrace();

   }

Upvotes: 0

Views: 189

Answers (1)

PHPFan
PHPFan

Reputation: 796

Oh...

I have know the answer.

I should close my RecordStore into each block of code after finishing of using

it,throughout the program.

                   try
{

recordStore2.closeRecordStore() ;

}

catch(Exception e)

{

e.printStackTrace();

}

Upvotes: 0

Related Questions