emilsjolander / sprinkles

Sprinkles is a boiler-plate-reduction-library for dealing with databases in android applications
Apache License 2.0
772 stars 84 forks source link

Support for saveAsync passing in a transaction. #74

Closed jordi-chacon closed 10 years ago

jordi-chacon commented 10 years ago

Hi!

It would be very useful to have:

void saveAsync(Transaction t); void saveAsync(Transaction t, OnSavedCallback callback);

Same goes for deletes. Do you have any plans for implementing this?

Thanks and have a good day!

emilsjolander commented 10 years ago

How would you decide to commit or rollback a transaction in this case? Also, there is really nothing that promises the order in which the saves/deletes will happen which makes this api very hard to support. I suggest you use the synchronous methods and wrap those in an async task.

jordi-chacon commented 10 years ago

Thanks Emil, your suggestion is a great idea and that's exactly what I did. It works very well so thank you!