I've recently joined a fairly big new project which has an unusual architecture of having a seperate SessionFactory for each module of the project. All the modules are deployed together in a single WAR file. There is also a common module with a number of hibernate mappings, that is included in each other modules hibernate mappings.
I can understand multiple session factories when there is different datasources, but all the tables are in the single database. So what we have is multiple session factories that have mappings to the same User, Audit, Message etc tables. There is a facade for each module, where the transactional boundries are, that only talk to one particular SessionFactory each.
It seems wrong to have multiple session factories mapping to the same tables in one application, but I need some solid reasons before I could convince them to change it. Any ideas what could go wrong? concurrency issues etc?
Thanks
|