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

Add ability to close FlowManager without reset database #1418

Closed
carmas123 opened this issue Aug 28, 2017 · 2 comments
Closed

Add ability to close FlowManager without reset database #1418

carmas123 opened this issue Aug 28, 2017 · 2 comments
Assignees
Milestone

Comments

@carmas123
Copy link

DBFlow Version: 4.10
Issue Kind (Bug, Question, Feature): Feature

Before all, thank you so much for your big release (4.10).

Description:
I need to have a static method into FlowManager that deinitialize the FlowManager to be reinitialized with init() method.
We can have a method like this into "FlowManager.java":

    /**
     * Close reference to context and {@link FlowConfig}
     */
    public static synchronized void close() {
        Set<Map.Entry<Class<?>, DatabaseDefinition>> entrySet =
            globalDatabaseHolder.databaseClassLookupMap.entrySet();
        for (Map.Entry<Class<?>, DatabaseDefinition> value : entrySet) {
            value.getValue().close();
        }

        config = null;

        // Reset the global database holder.
        globalDatabaseHolder = new GlobalDatabaseHolder();
        loadedModules.clear();
    }

My best regards.

@baranowskinet
Copy link

I also has the same problem and for now I have work around by pass flag to application method:
@OverRide
public boolean deleteDatabase(String name) {...}
to prevent delete db.

As I mentioned in another post better will be to have it per individual database (by class or even better by db name).

@agrosner
Copy link
Owner

added method for 4.1.2 in develop now.

@agrosner agrosner self-assigned this Oct 15, 2017
@agrosner agrosner added this to the 4.1.2 milestone Oct 15, 2017
@agrosner agrosner mentioned this issue Oct 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants