How to create a realm transaction on the same thread from several webservice results
up vote
1
down vote
favorite
We have a big amount of data to insert into a realm database. The data are coming from several webservices for a total amount of 100Mb to 1Gb.
We need to store each result from network with a transaction. If all the webservices are downloaded successfully, after a post-process we commit the database.
Due to the fact that realm for that transaction requires to work on the same thread and that the webservice are asynchrone, the problem we are facing is that we are not able to call the same thread after a webservice result, how can we manage to handle this situation?
Note:
We cannot load all the data in memory -> the huge amount of data is putting at risk the memory exception
Storing the result of webservice response in files and loading file by file are not very efficient -> we did this but the performance are bad (we spend 30% of processing the management of the file decoding…)
ios swift realm
add a comment |
up vote
1
down vote
favorite
We have a big amount of data to insert into a realm database. The data are coming from several webservices for a total amount of 100Mb to 1Gb.
We need to store each result from network with a transaction. If all the webservices are downloaded successfully, after a post-process we commit the database.
Due to the fact that realm for that transaction requires to work on the same thread and that the webservice are asynchrone, the problem we are facing is that we are not able to call the same thread after a webservice result, how can we manage to handle this situation?
Note:
We cannot load all the data in memory -> the huge amount of data is putting at risk the memory exception
Storing the result of webservice response in files and loading file by file are not very efficient -> we did this but the performance are bad (we spend 30% of processing the management of the file decoding…)
ios swift realm
I would create a temporal realm (you can specify the path of the realm in theRealm.Configurationwhen create theRealm) and when all the transactions commit, merge the temporal to the real.
– hfehrmann
Nov 9 at 14:27
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
We have a big amount of data to insert into a realm database. The data are coming from several webservices for a total amount of 100Mb to 1Gb.
We need to store each result from network with a transaction. If all the webservices are downloaded successfully, after a post-process we commit the database.
Due to the fact that realm for that transaction requires to work on the same thread and that the webservice are asynchrone, the problem we are facing is that we are not able to call the same thread after a webservice result, how can we manage to handle this situation?
Note:
We cannot load all the data in memory -> the huge amount of data is putting at risk the memory exception
Storing the result of webservice response in files and loading file by file are not very efficient -> we did this but the performance are bad (we spend 30% of processing the management of the file decoding…)
ios swift realm
We have a big amount of data to insert into a realm database. The data are coming from several webservices for a total amount of 100Mb to 1Gb.
We need to store each result from network with a transaction. If all the webservices are downloaded successfully, after a post-process we commit the database.
Due to the fact that realm for that transaction requires to work on the same thread and that the webservice are asynchrone, the problem we are facing is that we are not able to call the same thread after a webservice result, how can we manage to handle this situation?
Note:
We cannot load all the data in memory -> the huge amount of data is putting at risk the memory exception
Storing the result of webservice response in files and loading file by file are not very efficient -> we did this but the performance are bad (we spend 30% of processing the management of the file decoding…)
ios swift realm
ios swift realm
asked Nov 8 at 15:17
Nicolas Lauquin
1,03221121
1,03221121
I would create a temporal realm (you can specify the path of the realm in theRealm.Configurationwhen create theRealm) and when all the transactions commit, merge the temporal to the real.
– hfehrmann
Nov 9 at 14:27
add a comment |
I would create a temporal realm (you can specify the path of the realm in theRealm.Configurationwhen create theRealm) and when all the transactions commit, merge the temporal to the real.
– hfehrmann
Nov 9 at 14:27
I would create a temporal realm (you can specify the path of the realm in the
Realm.Configuration when create the Realm) and when all the transactions commit, merge the temporal to the real.– hfehrmann
Nov 9 at 14:27
I would create a temporal realm (you can specify the path of the realm in the
Realm.Configuration when create the Realm) and when all the transactions commit, merge the temporal to the real.– hfehrmann
Nov 9 at 14:27
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53210710%2fhow-to-create-a-realm-transaction-on-the-same-thread-from-several-webservice-res%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I would create a temporal realm (you can specify the path of the realm in the
Realm.Configurationwhen create theRealm) and when all the transactions commit, merge the temporal to the real.– hfehrmann
Nov 9 at 14:27