Closed GoogleCodeExporter closed 9 years ago
It appears that the bugs are in the svenson library and not the couchdb. I was
able
to get the code above to work above by modifying this method: parseObjectInto
in the
class: org.svenson.JSONParser.
I need to study the code a bit before posting to the svenson site.
I also modified the method: expect in org.svenson.tokenize.Token
See attached file for more details...
Original comment by mike.gb...@gmail.com
on 19 Feb 2010 at 2:40
Attachments:
This doesn't look like a bug in svenson to me.
First of all, it's right: There is no property "ok" in java.util.ArrayList. The
question is why is there an "ok", when it thinks it's parsing an array?
(The bulk creation tests in jcouchdb still work, btw..)
which couchdb version are you using?
can you set the detail for org.apache.http.headers logger to DEBUG?
if you're using log4j, this would be done like
log4j.logger.org.apache.http.headers=DEBUG
If you run your code again it should then log the actual HTTP headers jcouchdb
is
sending and receiving. Maybe that's going to help.
Original comment by ff...@gmx.de
on 19 Feb 2010 at 5:30
copy of a comment in the svenson issues:
bulk support is generally supported, as evidenced by multiple test cases. There
might
be a real bug hidden somewhere but I need more details to tell more.
As I said in the jcouchdb issue. This is not a svenson bug.
I see no way that the svenson code passes all svenson and jcouchdb test cases
but
suddenly starts phantasizing about non-existing "ok" properties in ArrayList.
The bug also does not happen on the way to couchdb but during the parsing of
couchdb
answer.
So somewhere there is a reason why your test case differs from the behaviour
tested
to be correctl in the jcouchdb test cases. Another couchdb version, another
option,
some special case behaviour etc. With the current information I cannot say more.
Original comment by ff...@gmx.de
on 24 Feb 2010 at 3:58
{{{
package org.jcouchdb;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import java.util.ArrayList;
import java.util.List;
import org.jcouchdb.db.Database;
import org.jcouchdb.db.LocalDatabaseTestCase;
import org.jcouchdb.document.BaseDocument;
import org.jcouchdb.document.DocumentInfo;
import org.junit.Test;
public class BulkWriteBugTestCase
{
@Test
public void test()
{
Database db = LocalDatabaseTestCase.recreateDB("bulk-bug");
final int num_docs = 1000;
List<BaseDocument> documents = new ArrayList<BaseDocument>(num_docs);
for (int i=0; i < num_docs; i++)
{
BaseDocument doc = new BaseDocument();
doc.setProperty("data", "The quick brown fox jumps over the lazy dog.");
doc.setId(null);
doc.setRevision(null);
documents.add(doc);
}
List<DocumentInfo> infos = db.bulkCreateDocuments(documents);
assertThat(infos, is(notNullValue()));
assertThat(infos.size(), is(num_docs));
}
}
}}}
This test passes for me.
Original comment by ff...@gmx.de
on 24 Feb 2010 at 5:05
I just commented again on the svenson site with a trace of a debug session. If
I do
an update on the trunk of both projects I still get the exception. The test
above
is not in the trunk of couchdb???
Just so I can put this behind me and stop bothering you guys what version of
couchdb
and svenson should include???
Original comment by mike.gb...@gmail.com
on 24 Feb 2010 at 5:29
The WritePerf test was @Ignored because it is pretty pointless as a test but I
wanted
to keep it nevertheless
the tests I meant are
org.jcouchdb.db.LocalDatabaseTestCase.thatBulkCreationWithIdsWorks() etc
all svenson and jcouchdb tests work fine for me with the current SVN trunk of
jcouchdb and the svenson 1.3.6, which is still the current trunk, too
couchdb version is 0.10.0 (the one with ubuntu karmic)
haven't got 0.10.1 to build on my system and I'm still pretty tight on time
jobwise.
Original comment by ff...@gmx.de
on 24 Feb 2010 at 6:51
I'm starting to get the suspicion that you're using 0.10.1 and the CouchDB
team, in
it's infinite wisdom decided to suddenly break the response of bulk
creates/updates
in between 0.10.0 and 0.10.1 without even bothering to add it to the "Breaking
Changes" wiki page.
Original comment by ff...@gmx.de
on 24 Feb 2010 at 7:37
I'm using couchdb 0.8.1...could this be a problem?
If it is I apologize for not adding that piece to the original post. I just
thought
it would give you piece of mind :)
I was able to get all my data loaded by modifying the svenson code, but this is
not
optimal. I'm currently in R&D mode, so it doesn't matter too much. Plus,
getting
couchdb and all it's dependencies built and installed on my Linux box was not a
simple task.
Do these number sound close? Loaded 12,122 5k records in 58 seconds? It's
around
209 recs/second. I used a batch size of 200, but have not optimized the id's
yet...
Original comment by mike.gb...@gmail.com
on 25 Feb 2010 at 10:10
oh.. the last version meant to be run against 0.8.1 was
http://jcouchdb.googlecode.com/files/jcouchdb-0.7.2.jar -- that was even before
the
naming convention change.
But it is really old and nothing was back-ported (so it lacks many features).
I'll close this now.
Original comment by ff...@gmx.de
on 25 Feb 2010 at 10:16
Original issue reported on code.google.com by
mike.gb...@gmail.com
on 18 Feb 2010 at 3:46