Hi Maciej,
Actually, before I saw the Martin's patch, I have just create a patch just as same as you mentioned, But I am worried if people have to configure JTA twice, both in hibernate.cfg.xml and jbpm.cfg.xml, they could make mistake. So I think Martin's patch may be better.
About JBPM-2798, I am really not sure if this is caused by the compositeIds(), so I think we could deplay this issue and wait for somebody to clarify it.