Hi, The suggested fix works with at least some limited testing in HermesJMS.
Regards, Colin. http://hermesjms.com -----Original Message----- From: Gordon Sim [mailto:[EMAIL PROTECTED] Sent: 11 September 2006 08:43 To: [email protected] Subject: [java] Re: Bug: BytesMessage.reset() throws MessageNotWriteableException Apologies for slow reply, was out of the office for a couple of days... Martin Ritchie wrote: > I'm sure flip() is correct and all that need be done is remove the > checkWritable() call. It would be good if someone (I guess Robert or > Gordon) more familiar with this bit of code could OK this change. I believe the idea behind the current code is that reset() gets called to make a writable message readable. Whether this is required or not I can't say for sure, but as pointed out at the start of this thread it should allow users to invoke it multiple times once the message is readable though. > public void reset() throws JMSException > { > //checkWritable(); > _data.flip(); > _readable = true; > } I think we still want to check whether the message is writable, and if it is call _data.flip(), if it isn't call _data.rewind(). i.e. along the lines of: if(_readable){ _data.rewind(); }else{ _data.flip(); _readable = true; }
