H2 database in Cronapp

Asked

Viewed 204 times

-2

I received the following message when trying to publish the application in Cronapp: "Your project uses an H2 database. Data persisted in this type of database may be lost due to distributed and stateless cloud architecture. We suggest using another type of database. Still do you want to continue?" How can I create another type of database?

1 answer

0

Cronapp’s development environment uses the H2 database, which uses memory for disk storage. Containers where applications are published in Cronapp do not have disk storage.

That way, when your application is published, you can even use the H2 database and everything will work including writing and reading data, but when you stop the application the container will be shut down, and when it is started again, the data will be gone, because they were only in the memory of the initial container, which was shut down. To create a cloud database using Cronapp IDE follow these steps:

  1. Click on Data Source (opens the tab )
  2. Click on the button
  3. Click on the link
  4. You are redirected to the console that displays the list of banks available
  5. Click the [+] button to add
  6. Enter the name of the new database
  7. The name of the created bank appears in the list
  8. Return to the Data Source tab by clicking on it
  9. Select the name of the created database from the list of databases in the cloud
  10. Click on
  11. Database is created and appears in the list of data sources of project

Note that in addition to creating the database in the cloud, you need to adjust your application to use the new data source created. If you are using the persistence layer generation engine through the diagram, log into the diagram and change the data source by selecting from the available list the new data source that corresponds to your newly created cloud database. You will find more information on: https://docs.cronapp.io/display/CRON2/Bancos+de+dados+na+Nuvem

Browser other questions tagged

You are not signed in. Login or sign up in order to post.