Can't Open 2 App

Hi, i’m attempting to open 2 Screens, with One Server, and Two projects at same time.

First project with their tomcat port, and the other with other port.

When i Open the second project, i get an error:
[15:15:20.766] HSQLDB connection error
java.sql.SQLException: Error general: database alias does not exist
java.sql.SQLException: Error general: database alias does not exist
[15:15:21.103] Ready

If i close, the firts, i can start second without any Error. If i reopen the first, this get same error.
[15:15:20.766] HSQLDB connection error
java.sql.SQLException: Error general: database alias does not exist
java.sql.SQLException: Error general: database alias does not exist
[15:15:21.103] Ready

We wait your comments,

Hi,
It is not recommended to run multiple projects with HSQLDB at the same time. Use an external DB (Postgre, MySQL or others) instead of HSQLDB.

On production multiple applications with HSQLDB may run after enabling HSQL in-process mode.
WAR building task has the corresponding option (see https://doc.cuba-platform.com/manual-6.2/build.gradle_buildWar.html)
But we should not use it for development purposes, because the Studio could not correctly work with such database.

Regards.

Hmmm, i understant but, for us is good to open two projects, for example for copy som screens configurations… How can i do this ?

Hi

Using IDE you can open and edit as many projects as you wish.
Studio allows to open only one project for edit. You can open other projects in read-only mode from another browser window.

You can start multiple Tomcat servers(from studio or manually) if they use “external” DB(Postgre, MySQL etc).
You can start multiple Tomcat servers if they use HSQLDB with In-process mode enabled.

But if you start multiple hot deployed by Studio applications with HSQLDB(without “In-process”), the error will occur.

Hi,

you can also run as many studio instances as you want if you containerize them. I asked a few weeks ago for an official Docker image for studio (see this topic). After it is published that should just work.

For now you can do your own Docker image with studio like this:
0. install docker (either on linux, mac or windows)

  1. create a file called “Dockerfile” with the following content:
FROM openjdk:8-jdk
ADD studio /usr/local/bin/studio/
ENV STUDIO_OPTS '-Dstudio.connection.remote.enable=true'
EXPOSE 8111
CMD ["/usr/local/bin/studio/bin/studio", "-nogui"]
  1. copy the extracted folder from your studio download in the same directory as the Dockerfile (the name of the folder has to be “studio”).
  2. execute: "docker build -t cuba-studio . " in the directory of the Dockerfile to build the docker image (up to this step the effort is just for now until Haulmont offers studio via dockerhub).
  3. run the container: “docker run -it --rm -p 8222:8111 cuba-studio” will give you the studio under port 8222
  4. run as many instances as you want (with step 4) and different port mappings

Bye,
Mario