Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite file handle is not released, so cloud sync will not pick up changes #2

Open
cmeury opened this issue Nov 12, 2021 · 8 comments

Comments

@cmeury
Copy link
Owner

cmeury commented Nov 12, 2021

At the moment, this project does not work as intended, because it will not release the file handle of the DB file. So a cloud sync tool cannot pick up changes. I investigated quite a bit on how to get SQLAlchemy to release the handle after every request, but couldn't figure it out so far. I think I have to to switch to manual connections with the sqlite package directly.

@jjohnson338
Copy link
Collaborator

jjohnson338 commented Nov 12, 2021

Hi there. Taking a look into it, maybe the fix is to open the db every time a query needs to be executed and close the connection and dispose the db after the query has been executed?

Python isn't my forte, but maybe this is a step in the right direction?

https://stackoverflow.com/questions/8645250/how-to-close-sqlalchemy-connection-in-mysql

@jjohnson338
Copy link
Collaborator

Looked a bit into the SQLAlchemy Flask dependency. I'm thinking you are right. Probably need to do the mapping with sqllite directly. I'm not seeing a way to clear our the session, connection, and db. I can try to help with that, but I would need a little bit of spin up on Flask and python in general. Although I had created a docker wrapper for the main application that's web accessible, I still have need for a small web-app such as this for logging on the go (with my phone). Let me know if there is anything I can do to help.

@cmeury
Copy link
Owner Author

cmeury commented Nov 12, 2021

Yeah, had the same thinking. I might find some time on Sunday to tinker around with it.

Why can't you use your wrapper on the phone? Too tiny?

@jjohnson338
Copy link
Collaborator

It's possible, but it doesn't dynamically scale the UI. Effectively it runs the full desktop application on a statically sized, web accessible Linux desktop environment (openbox in this case). Just kind of cumbersome to use from a mobile browser. The big advantage I see of this application over that is the ability to quickly log transactions on the go until the official mobile app comes out down the road. Appreciate your work so far on this!

@jjohnson338
Copy link
Collaborator

FYI I'm using Nextcloud as the sync service for my .buckets files and it's seemingly syncing just fine following an update via this web-app.

@jjohnson338
Copy link
Collaborator

I've installed Dropbox on my local machine and passed a DB file stored there into the running docker (off of main using SQLAlchemy) and added a transaction via the website. In my case, Dropbox immediately picked up the change. Perhaps this is an environmental issue?

If there are any other tips you can provide me to try to replicate this issue, I can see if #8 solves the problem. Otherwise, I might close this issue and close #8

@cmeury
Copy link
Owner Author

cmeury commented Nov 21, 2021

In all honesty, I don't think I'll be using Buckets, even with the app it makes my whole workflow quite cumbersome. So I'd definitely hand this over to you, if you want! You have my blessing :)

@jjohnson338
Copy link
Collaborator

Sure. I'm planning on using this at least until the official mobile application comes out and will continue to make improvements. I'll happily inherit the repo, if that is what you are suggesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants