Greetings.
I have several databases with identical schemas. According to the Hibernate FAQ I need to configure a SessionFactory for each of these databases. However, loading mapping files is quite a lenthy process, so the approach that my colleague was using was to alter hibernate.connection.url at run-time. He was replacing the current database name with new one he needed to use next.
However, database urls are different from vendor to vendor, so URL string manipulation is not the best way to accopmplish switching to another database.
What is the right (and efficient) way to switch to another database with the identical to the current database schema?
Thanks.
Alec
|