I thought that it would be possible to implement it so that if developer needs to connect to only one database everything would be exactly as now.
Connecting to other databases would be possible if developer added one more hibernate.cfg.xml file. The second file should be named hibernateIdentifier.cfg.xml. Also entities package should be entities.identifier.
Without identifier Tapestry would create the normal session that can be Injected using just
private Session session
The other session(s) should be accessed using
private Session identifierSession
I don't know if this is too far-fetched, but I'm just adding this like I would like to use it. And this would be consistent approach with the convention over configuration way of thinking.
This would introduce new things to @CommitAfter handling ofcourse (commit all session instance's transactions) and it should also introduce new annotation (Or parameter to @CommitAfter) witch would ofcourse be @CommitAfter(value="identifier1,identifier2")