Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

There is no possibility to establish a connection to the Postgress cluster #2286

Open
@Dem1616

Description

Hibernate reactive 3.0, vertx 4.5.14.
When specifying multiple hosts in the connection string along with the parameter targetServerType=master, the connection pool is not created

 public Mutiny.SessionFactory getSessionFactory(@Qualifier("VertxMain") Vertx vertx) {
 Properties hiberProps = new Properties();
 hiberProps.put("jakarta.persistence.jdbc.url", "jdbc:postgresql://host1:5433,host2:5433/db?targetServerType=master");
 ...
 org.hibernate.cfg.Configuration cfg = new org.hibernate.cfg.Configuration();
 ...
 cfg.addProperties(hiberProps);
 Mutiny.SessionFactory sessionFactory =
 cfg.buildSessionFactory(new ReactiveServiceRegistryBuilder().applySettings(cfg.getProperties()).build())
 .unwrap(Mutiny.SessionFactory.class);
 
 return sessionFactory;
 }

In such a configuration, the connection pool is not created:
Cannot invoke "io.vertx.sqlclient.Pool.getConnection()" because "pool" is null
In the interface SqlClientPoolConfiguration, the method connectOptions accepts a parameter of type URI, which comes from the setting jakarta.persistence.jdbc.url and assumes parsing only a single host value from the connection string.

How can I achieve a similar connection behavior in Hibernate Reactive as in Hibernate ORM, so that the connection is made specifically to the host that acts as a master in the cluster?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /