Sometimes closeRecordStore() takes a lot of time while executing.

I simply delete a record from the recordStore and close it, but sometime recordstore cloosed in fraction of second and sometimes it takes a lot of time(1-2 min).
[168 byte] By [Ashish_Javaa] at [2007-10-3 10:05:26]
# 1
plz show some code
sailesh_dita at 2007-7-15 5:24:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

RecordStore rsImageData = null;

try {

rsImageData = RecordStore.openRecordStore(RSIConst.RS_IMAGE_DATA,

false);

if (rsImageData.getNumRecords() == 1) {

rsImageData.closeRecordStore();

RecordStore.deleteRecordStore(RSIConst.RS_IMAGE_DATA);

Const.htOfflineDataTable.clear();

Const.htOfflineDataTable = null;

} else {

rsImageData.deleteRecord(p_offlineDataIndex);

rsImageData.closeRecordStore();

}

} catch (Exception e) {

}

Thanks,

Ashish

Ashish_Javaa at 2007-7-15 5:24:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3

> RecordStore rsImageData = null;

> try {

> rsImageData =

> a =

> RecordStore.openRecordStore(RSIConst.RS_IMAGE_DATA,

> false);

this means if recordstore doesn't exists don't create it

> if (rsImageData.getNumRecords() == 1) {

> rsImageData.closeRecordStore();

> RecordStore.deleteRecordStore(RSIConst.RS_IMAGE_DA

> TA);

//and here you are deleteing it !

> Const.htOfflineDataTable.clear();

> Const.htOfflineDataTable = null;

> } else {

> rsImageData.deleteRecord(p_offlineDataIndex);

> rsImageData.closeRecordStore();

> }

> } catch (Exception e) {

> }

>

> Thanks,

> Ashish

so either pass true in ur parameter while creating it

or don't delete it

sailesh_dita at 2007-7-15 5:24:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4

In my application when i used this code its sure that RecordStore is present that why i used false.

Data is deleted properly, there is no issue while deleting the record.

RecordStore also closed after deleting the record.

The problem is time taken by closeRecordStore is not consistent.

Ashish

Ashish_Javaa at 2007-7-15 5:24:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 5
if (rsImageData.getNumRecords() == 1) {> rsImageData.closeRecordStore();> RecordStore.deleteRecordStore(RSIConst.RS_IMAGE_DA> TA);if numrecords are one you are deleteing itso it will never be created again
sailesh_dita at 2007-7-15 5:24:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 6
As I wrote previously, in my application I always have a RecordStore and my problem is not about the existance of RecordStore .Ashish
Ashish_Javaa at 2007-7-15 5:24:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 7
> As I wrote previously, in my application I always> have a RecordStore and my problem is not about the> existance of RecordStore .What do you mean you always have a RecordStore ?u are deleting it and opening at false watch your code
sailesh_dita at 2007-7-15 5:24:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 8
Before the execution of these lines i called a fucntion which open the recordstore and store some data into it, hope now you understand what i want to say.
Ashish_Javaa at 2007-7-15 5:24:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 9
i understand nowhow can i understand if you show only a part of picture ..:)
sailesh_dita at 2007-7-15 5:24:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 10
Yes its a type of miss communication, well my problem is still persist.
Ashish_Javaa at 2007-7-15 5:24:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 11
if it's possible can u post whole codeor mail me
sailesh_dita at 2007-7-15 5:24:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 12
helloI have the same issue.Have you find a solution or an explicationthanksMessage was edited by: chabfive
chabfivea at 2007-7-15 5:24:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 13
Which a kind of device you're using?Have you tried other devices like Moto or SonyEricsson?
Andrey_Hohutkina at 2007-7-15 5:24:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...