Persist database connections

I have configured database connections to an external psql database. 

After reboot all of my connections are lost , even when I set them to global. This is very annoying . 

 

How can I persist the connection between start ups?

0
8 comments

Hi Daniel,

By lost, do you mean you don't see them in the Database tree view?

They should persist between restarts - unless something messes up the IDE configuration files or project files (Antivirus software or OS cleanup tool, for instance).

  • Project-specific data sources are stored in the .idea directory inside the project. They are represented by the dataSources folder and dataSources.local.xml files.
  • Global (shared) data sources are stored in <IDE config dir>\options\dataSources

Do you see any files in the mentioned directories before and after you close the IDE? What about after you reopen it?

0

I have setup a global data source in my ide that is currently running. But there is nothing in the described dataSource path

0

When I close the IDE and open it again , the database is still there. But when I reboot my laptop the connection is gone. 

0

How are you adding the data source exactly? How are you making it global? Please describe the steps.

Please also provide a screenshot of the 'Data Sources and Drivers' dialog with the list of data currently added data sources visible on the left.

When the data source is added in the IDE, do you see any files or folders added to the /dataSources dir?

Does the user under which the IDE is launched have enough permissions to read/write to the /dataSources dir?

Do you have this problem with project-level data sources too?

0

Dear Arina, it has more to do with how ide settings are persistet in general. Because I often shut down the ide / and the laptop and the only proejcts that pycharm rembered to open was from a session 2 months ago. And then suddendly it changes and i do not know why. Because now some of the db connections are there after reboot. 

0

Hello,

The issue of connections disappearing between restarts is uncommon, so to help us troubleshoot, we would need answers to Arina’s questions, especially the following:

1. Just to confirm, the issue you're experiencing is that the configured data sources are missing from the Database Explorer tree view, correct?

2. Do you have any antivirus software or OS cleanup tools?

3. Are there any data source files (dataSources.xml or dataSources folder) in the .idea directory inside the project? Do you see such files anywhere (in .idea or options directories) before and after restarts?

4. How exactly are you adding the data sources? How are you making it global? Please describe the steps.

5. You wrote that some of the db connections are there after reboot. Are there any differences between the connections that persist and those that disappear? Have you noticed any patterns?

Also, what is your current PyCharm and Database Tools plugin versions?

0

Currently , the data connections are there and available even when I reboot my laptop. 

 

But what I do not understand is how pycharm sometimes does not rember my previous session. Is it because I reboot without closing the ide before?

 

Best regards

Daniel 

0

Daniel,

Could you please elaborate on what exactly you mean by “pycharm sometimes does not remember my previous session”? The more specifically you describe the issue and answer our previous question, the faster we’ll be able to understand it and assist in resolving it.

0

Please sign in to leave a comment.