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
  •  | 
  •  

문제

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 ?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top