Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-66

Inserting very large java.util.Collections into DBCollection causes a buffer overflow exception

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2
    • Affects Version/s: 1.1, 1.2
    • Component/s: None
    • None

      When inserting a very long list of DBObjects, a bufferoverflow exception is thrown:

      Exception in thread "main" java.lang.IllegalArgumentException: tried to save too large of an object.  max size : 2098176
      	at com.mongodb.ByteEncoder.putObject(ByteEncoder.java:175)
      	at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:203)
      	at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:162)
      	at tv.miniweb.mediasearch.indexer.Indexer.Index(Indexer.java:54)
      	at tv.miniweb.mediasearch.indexer.IndexerLauncher.main(IndexerLauncher.java:53)

      This is because a single ByteEncoder is used for the entire .insert request, which is IMO not optimal behaviour in this case. I have pushed a git changeset with a patch and unit tests that fix this.

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            philmes Phil Messenger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: