Try breaking your processing in smaller units of work. Having long running transactions is usually a bad idea. You could raise the transaction timeout but doing so would only remove the symptoms not the root evil (prolonged database held locks, higher potential for database contention, etc..)
The default Jboss transaction timeout is 5 minutes I think. If you want to increase it (bearing in mind what Guillaume has said) then you can change it in $JBOSS_HOME/server/default/conf/jboss-service.xml.