Attachments and temp_ attachments folder use in couch base lite

Hi All,

I know that attachments hold attachments save through couchbase lite but what is kept inside temp attachments folder. It is also the attachments but which one. what is the process ?

Pankaj Sharma

Attachments are stored in there while they’re being downloaded; then the files are moved to the regular Attachments directory. So that directory only ever contains partial attachments.

Thanks @jens

I am creating a zip at the run time on a App server. The service is in Java having couch base lite. At the start one shot is run and after all data has arrived I create a Zip which is downloaded by the App on first launch.

At what time or event all the attachments in temp_attachments will finish processing?

I want to know this so that after this finish is done I can create a zip. Right now we are saving around 6000 photographs having a size range from 2 Kb to 10 Kb. But I see that the attachment + temp_attachment size is much larger then what it should be.

All attachments are downloaded by the time the replication state goes to stopped/idle.

In Java is the temp attachments directory inside the database directory? That doesn’t seem right. It should be in a system temporary directory like /tmp.

By default temp attachments directory is inside attachments. This is also applicable to .Net,Java and Android.

One more question :- What happens if we create a zip in between of processing and start using it in the app?

I’m not quite sure what you’re asking. You should never archive the database while it’s open. Close it first, then create the zip archive.

And on the other side, you should only use the Manager’s copyDatabase method to install a database. There are some things inside that need to be fixed up before it can be used on a new system (most importantly, new UUIDs need to be assigned, since the ones from the copy are of course no longer unique.)

Thanks for the TIP. Right now we are creating a zip file on the server (a java app which works as a client ) which is sent to the clients on their first launch because there are 55000+ docents which they will need to sync. Before archiving I am stopping the replication but not closing the database. I will try this and see if this TIP improves things.