1) Can I switch the session used by a POJO? Say I do a session1.load(obj.Class,id) then do a session2.switch(obj,id) then session2.save(obj.id)?
2) I have about 20 tables on the master which are used for updating, the slaves are used for reading.I'll replicate 10 of those tables on machine A, then I'll replicate the other 10 on machine B. Both machines will have their respective table rows propagated from the master server while the tables that aren't propagated are left blank. Also, there are no foreign keys. So could I use the same hibernate.cfg.xml file on machine A and B, just making sure I access via Hibernate the tables the machine has rows for?
Here's what the setup looks like:
Code:
--------
| master |
--------
| |
--- ---
| A || B |
--- ---
Thanks.