addRecord hangs
Hi,
addRecord hangs during the call
The code is as follow:
public void updateRecord(String record) {
if(record != null)
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream outputStream = new DataOutputStream(baos);
try{
outputStream.writeUTF(record);
}catch (IOException ioe) {
System.out.println(ioe);
}
byte[] recordByte = baos.toByteArray();
try{
myRecordStore.addRecord(recordByte, 0, recordByte.length);
}catch(RecordStoreException rse){
System.err.println(rse.toString());
}
}
}
When I trace the code, it get stuck on "addRecord" call and never comes out.
Note that the RecordStore is already open and also the values all seem to be valid during debug.
any help will be much appreciated.
Thanks,
S.
>public void updateRecord(String record) {
>if(record != null)
>{
> ByteArrayOutputStream baos = new
> ByteArrayOutputStream();
> DataOutputStream outputStream = new
> DataOutputStream(baos);
>
> try{
>outputStream.writeUTF(record);
///here close output Stream
outputStream.close();
> }catch (IOException ioe) {
> System.out.println(ioe);
>}
>byte[] recordByte = baos.toByteArray();
also check if recordByte !=null
>try{
> myRecordStore.addRecord(recordByte, 0,
> recordByte.length);
>}catch(RecordStoreException rse){
>System.err.println(rse.toString());
>}
> }
>}
> hen I trace the code, it get stuck on "addRecord"
> call and never comes out.
>
> Note that the RecordStore is already open and also
> the values all seem to be valid during debug.
>
> any help will be much appreciated.
>
> Thanks,
> S.