Jini
New Member
Posts: 3
|
Post by Jini on Jan 21, 2021 2:12:34 GMT
Hi, I am using simpleSQL, and I am so satisfied. Thank you for making a good Asset. The figure below shows the DBManager applied when Scene starts. During runtime, I want to change VIEW.bytes(DB file). 1. Download new VIEW.bytes from server 2. Apply downloaded new VIEW.bytes 3. Delete old VIEW.bytes. To succeed in these three things, I wonder exactly what procedures are needed. Do I just need to put the path to the folder that contains the downloaded file to overrideBasePath? After changing overrideBasePath, if I try to delete old VIEW.bytes, a File Sharing error appears. old VIEW.bytes cannot be deleted. I will attach a part of the code I used. Thank you. static public void SetDBBasePath(SimpleSQL.SimpleSQLManager dbManager, string downloadFolderPath)
{
//dbManager.Close();
//dbManager.Dispose();
dbManager.overridePathMode = SimpleSQL.SimpleSQLManager.OverridePathMode.Absolute;
dbManager.overrideBasePath = downloadFolderPath;
//dbManager.databaseFile.name = "VIEW";
//dbManager.Initialize(true);
}
|
|
|
Post by echo17 on Jan 21, 2021 16:14:56 GMT
Thank you for the kind words. You should call Dispose and Close on the SimpleSQLManager object before deleting or changing databases. For an example on how to load a database at runtime from your persistentDataPath, please see this FAQ: linkIf this does not solve your issue, I will need to see an example project that I can diagnose. Please see this FAQ for more information: link
|
|
Jini
New Member
Posts: 3
|
Post by Jini on Jan 25, 2021 4:40:00 GMT
Am I right to understand?
When the DB to be replaced is in the persistent data path. dbManager.Close(); dbManager.Dispose(); dbManager.databaseFile.name = "MyDatabases/Fantasy"; //without file extension dbManager.Initialize(true);
When the DB to be replaced is not in the persistent data path.
dbManager.Close(); dbManager.Dispose(); dbManager.overridePathMode = SimpleSQL.SimpleSQLManager.OverridePathMode.Absolute; dbManager.overrideBasePath = "D:/Download/Fantasy"; //without file extension dbManager.Initialize(true);
|
|
|
Post by echo17 on Jan 25, 2021 13:43:51 GMT
Yes, your code looks correct.
|
|
Jini
New Member
Posts: 3
|
Post by Jini on Jan 30, 2021 6:00:26 GMT
Thank you!!
|
|