Can I have two databases related session-factory tags in a single hibernate.cfg.xml file?

StackOverflow https://stackoverflow.com/questions/4130840

  •  29-09-2019
  •  | 
  •  

Pergunta

I have two different databases where I need to connect and update the tables dynamically. But it looks like I cannot keep two sessions related information in configuration file. Is there any way to handle this ?

Foi útil?

Solução

Well, as you noticed, the root element of Hibernate's XML configuration file must declare one and only one <session-factory> element as per the DTD:

<!ELEMENT hibernate-configuration (session-factory,security?)>

So if you want to configure multiple session factories, either:

References

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top