Bugs item #2834658, was opened at 2009-08-10 03:29
Message generated for change (Comment added) made by shcheklein
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=713730&aid=2834658&group_id=129076

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: API
Group: Sedna (current)
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Justin Johansson (justinjohansson)
Assigned to: Ivan Shcheklein (shcheklein)
Summary: Undesirable newline prepended to SednaSerializedResult items

Initial Comment:
When there is more than one item retrieved via SednaSerializedResult next() 
loop, the second and subsequent items have a newline character ( \x0A ) 
prepended to them.
This is undesirable as it effectively introduces extraneous whitespace before 
these strings and it is necessary to then apply a substring function to remove 
the first character in order to preserve the correct string length of the 
returned items.

The following query expression illustrates this problem:

( 'aa', 'bb', 'cc')

Test code:

                                SednaSerializedResult prs = 
stmt.getSerializedResult();
                Vector<String> strs = new Vector<String>( 8);
                String pr = prs.next();

                int itemNo = 0;
                
                while ( pr != null) {
                        System.out.println( "SednaSerializedResult item #" + 
itemNo + "='" + pr + "'" + "(length=" + pr.length() + ")");
                        System.out.flush();
                        strs.add( pr);
                        pr = prs.next();
                        ++itemNo;
                }

                return strs;

Output:

SednaSerializedResult item #0='aa'(length=2)
SednaSerializedResult item #1='
bb'(length=3)
SednaSerializedResult item #2='
cc'(length=3)

In this test case, reasonable expectation is that three strings would be 
received back with String.length() method returning a value of 2 for each 
string as opposed to 2, 3 and 3 respectively.



----------------------------------------------------------------------

>Comment By: Ivan Shcheklein (shcheklein)
Date: 2011-05-29 19:07

Message:
Fixed in the development branch. Check it out here:
http://modis.ispras.ru/FTPContent/sedna/development/

----------------------------------------------------------------------

Comment By: Ivan Shcheklein (shcheklein)
Date: 2009-08-15 14:35

Message:
Hi Justin,

This a well know problem of the current (version 3) client-server
protocol. In current implementation Sedna server performs complete result
serialization (including spaces/newlines between items). 

Fortunately, new protocol (version 4) initial implementation has been
already commited (see Git Browse). In this version Sedna returns each item
with its XDM type so that serialization can be done on the client's side. 

I hope, we'll implement sednadriver2.jar very soon.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=713730&aid=2834658&group_id=129076

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Sedna-discussion mailing list
Sedna-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sedna-discussion

Reply via email to