osdir.com
mailing list archive F.A.Q. -since 2001!



Subject: Re: [mongodb-user] MongoDB GridFS with sharding
and files more than 256K in C++ driver. -
msg#00674

List: mongodb-user

Mail Archive Navigation:
by Date: Prev Next Date Index by Thread: Prev Next Thread Index

Can you try using GridFS::storeFile instead?
-----Original Message-----
From: Anti Mavrodi <antimavrodi@xxxxxxxxx>
Sender: mongodb-user@xxxxxxxxxxxxxxxx
Date: Tue, 7 Feb 2012 12:15:30
To: <mongodb-user@xxxxxxxxxxxxxxxx>
Reply-To: mongodb-user@xxxxxxxxxxxxxxxx
Subject: Re: [mongodb-user] MongoDB GridFS with sharding and files more than
256K in C++ driver.

C++ driver save first 256K to disk and then an error "chunk is empty!"


7 февраля 2012 г. 11:04 пользователь Nat <nat.lueng@xxxxxxxxx> написал:

> - Can you get the result of
> use db_name
> db.collection_name.chunks.find( { "files_id" : ObjectId("ObjectId of
> the file that you had the problem") } )
>
>
> - Did you try it with slaveOk on? If so, can you try turning it off?
>
> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/mongodb-user/-/hRqn2N5BQ8wJ.
>
> To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxxx
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@xxxxxxxxxxxxxxxxx
> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.
>

--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
mongodb-user+unsubscribe@xxxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.


--
You received this message because you are subscribed to the Google Groups
"mongodb-user" group.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
mongodb-user+unsubscribe@xxxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/mongodb-user?hl=en.

Thread at a glance:

Previous Message by Date:

Re: [mongodb-user] Howto Catch Duplicate Key Exception in Java

I thought that too but MongoException.DuplicateKey isn't thrown. The only usage of DuplicateKey I could find is this line within CommandResult.java: <em> if ( code == 11000 || code == 11001 || s.startsWith( "E11000" ) || s.startsWith( "E11001" ) ) return new MongoException.DuplicateKey( code , s ); </em> Within CommandResult.getException. But the exception which is raised is a CommandResult.CommandFailure Exception which is no subclass of CommandResult but MongoException, so I can't call getException. If I miss something I'm happy if you can point it out, else I think this is a bug and I'll file a new ticket. Am Montag, 6. Februar 2012 18:10:08 UTC+1 schrieb Eliot Horowitz: > > You can catch MongoException.DuplicateKey > > On Fri, Feb 3, 2012 at 3:14 PM, PHeinze <philnate@xxxxxxxxx> wrote: > > Hi, > > > > when I try to insert a duplicate through this code: > > > > <em> > > try { > > > > coll.findAndModify( queryId( document ).and( "p.revision" ).is( > document.getRevision() ).get(), > > new BasicDBObject( "$set", mods ) ); > > } > > } > > catch ( MongoException e ) > > { > > </em> > > > > it correctly throws an Exception. But I can't retrieve the correct > > error code through .getCode() (it's always -5). Sadly I can't cast to > > CommandFailure the Subclass which is thrown as this is package > > private. Do I miss something or is the class wrongly private? > > The Exception I catch is following: > > <em> > > com.mongodb.CommandResult$CommandFailure: command failed [command > > failed [findandmodify] { "serverUsed" : "pheinze-0830:27017" , > > "lastErrorObject" : { "err" : "E11000 duplicate key error index: > > test.address.$ns_1_t_1_p.doc_id_1 dup key: { : \"__nn__\", : \"N\", : > > \"testPutPKTwice\" }" , "code" : 11000 , "n" : 0 , "connectionId" : > > 44 , "ok" : 1.0} , "errmsg" : "E11000 duplicate key error index: > > test.address.$ns_1_t_1_p.doc_id_1 dup key: { : \"__nn__\", : \"N\", : > > \"testPutPKTwice\" }" , "ok" : 0.0} > > </em> > > > > I know that I could call getlasterror and retrieve from there the > > correct error code, but I don't feel comfortable with this solution as > > the correct exception is already present but not accessable. > > > > Thanks for your help > > > > -- > > You received this message because you are subscribed to the Google > Groups "mongodb-user" group. > > To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxxx > > To unsubscribe from this group, send email to > mongodb-user+unsubscribe@xxxxxxxxxxxxxxxxx > > For more options, visit this group at > http://groups.google.com/group/mongodb-user?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "mongodb-user" group. To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-user/-/S8kgCvBUIDsJ. To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxxx To unsubscribe from this group, send email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

Next Message by Date:

Re: [mongodb-user] MongoDB GridFS with sharding and files more than 256K in C++ driver.

No. storeFile<http://api.mongodb.org/cplusplus/2.0.0/classmongo_1_1_grid_f_s.html#a5456b209e34865dfded04b2a5667d722> puts the file reference by fileName into the db. I try save file FROM db to disk. 7 февраля 2012 г. 13:38 пользователь Nat <nat.lueng@xxxxxxxxx> написал: > ** > Can you try using GridFS::storeFile instead? > ------------------------------ > *From: * Anti Mavrodi <antimavrodi@xxxxxxxxx> > *Sender: * mongodb-user@xxxxxxxxxxxxxxxx > *Date: *Tue, 7 Feb 2012 12:15:30 +0300 > *To: *<mongodb-user@xxxxxxxxxxxxxxxx> > *ReplyTo: * mongodb-user@xxxxxxxxxxxxxxxx > *Subject: *Re: [mongodb-user] MongoDB GridFS with sharding and files more > than 256K in C++ driver. > > C++ driver save first 256K to disk and then an error "chunk is empty!" > > > 7 февраля 2012 г. 11:04 пользователь Nat <nat.lueng@xxxxxxxxx> написал: > >> - Can you get the result of >> use db_name >> db.collection_name.chunks.find( { "files_id" : ObjectId("ObjectId of >> the file that you had the problem") } ) >> >> >> - Did you try it with slaveOk on? If so, can you try turning it off? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "mongodb-user" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/mongodb-user/-/hRqn2N5BQ8wJ. >> >> To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxxx >> To unsubscribe from this group, send email to >> mongodb-user+unsubscribe@xxxxxxxxxxxxxxxxx >> For more options, visit this group at >> http://groups.google.com/group/mongodb-user?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "mongodb-user" group. > To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxxx > To unsubscribe from this group, send email to > mongodb-user+unsubscribe@xxxxxxxxxxxxxxxxx > For more options, visit this group at > http://groups.google.com/group/mongodb-user?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "mongodb-user" group. > To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxxx > To unsubscribe from this group, send email to > mongodb-user+unsubscribe@xxxxxxxxxxxxxxxxx > For more options, visit this group at > http://groups.google.com/group/mongodb-user?hl=en. > -- You received this message because you are subscribed to the Google Groups "mongodb-user" group. To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxxx To unsubscribe from this group, send email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

Previous Message by Thread:

Re: [mongodb-user] MongoDB GridFS with sharding and files more than 256K in C++ driver.

C++ driver save first 256K to disk and then an error "chunk is empty!" 7 февраля 2012 г. 11:04 пользователь Nat <nat.lueng@xxxxxxxxx> написал: > - Can you get the result of > use db_name > db.collection_name.chunks.find( { "files_id" : ObjectId("ObjectId of > the file that you had the problem") } ) > > > - Did you try it with slaveOk on? If so, can you try turning it off? > > -- > You received this message because you are subscribed to the Google Groups > "mongodb-user" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/mongodb-user/-/hRqn2N5BQ8wJ. > > To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxxx > To unsubscribe from this group, send email to > mongodb-user+unsubscribe@xxxxxxxxxxxxxxxxx > For more options, visit this group at > http://groups.google.com/group/mongodb-user?hl=en. > -- You received this message because you are subscribed to the Google Groups "mongodb-user" group. To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxxx To unsubscribe from this group, send email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

Next Message by Thread:

Re: [mongodb-user] MongoDB GridFS with sharding and files more than 256K in C++ driver.

No. storeFile<http://api.mongodb.org/cplusplus/2.0.0/classmongo_1_1_grid_f_s.html#a5456b209e34865dfded04b2a5667d722> puts the file reference by fileName into the db. I try save file FROM db to disk. 7 февраля 2012 г. 13:38 пользователь Nat <nat.lueng@xxxxxxxxx> написал: > ** > Can you try using GridFS::storeFile instead? > ------------------------------ > *From: * Anti Mavrodi <antimavrodi@xxxxxxxxx> > *Sender: * mongodb-user@xxxxxxxxxxxxxxxx > *Date: *Tue, 7 Feb 2012 12:15:30 +0300 > *To: *<mongodb-user@xxxxxxxxxxxxxxxx> > *ReplyTo: * mongodb-user@xxxxxxxxxxxxxxxx > *Subject: *Re: [mongodb-user] MongoDB GridFS with sharding and files more > than 256K in C++ driver. > > C++ driver save first 256K to disk and then an error "chunk is empty!" > > > 7 февраля 2012 г. 11:04 пользователь Nat <nat.lueng@xxxxxxxxx> написал: > >> - Can you get the result of >> use db_name >> db.collection_name.chunks.find( { "files_id" : ObjectId("ObjectId of >> the file that you had the problem") } ) >> >> >> - Did you try it with slaveOk on? If so, can you try turning it off? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "mongodb-user" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/mongodb-user/-/hRqn2N5BQ8wJ. >> >> To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxxx >> To unsubscribe from this group, send email to >> mongodb-user+unsubscribe@xxxxxxxxxxxxxxxxx >> For more options, visit this group at >> http://groups.google.com/group/mongodb-user?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "mongodb-user" group. > To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxxx > To unsubscribe from this group, send email to > mongodb-user+unsubscribe@xxxxxxxxxxxxxxxxx > For more options, visit this group at > http://groups.google.com/group/mongodb-user?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "mongodb-user" group. > To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxxx > To unsubscribe from this group, send email to > mongodb-user+unsubscribe@xxxxxxxxxxxxxxxxx > For more options, visit this group at > http://groups.google.com/group/mongodb-user?hl=en. > -- You received this message because you are subscribed to the Google Groups "mongodb-user" group. To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxxx To unsubscribe from this group, send email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
blog comments powered by Disqus

Home | News | Sitemap | FAQ | advertise | OSDir is an Inevitable website. GBiz is too!