private boolean isTransactional ( SqlAction [ ] sqlActions , XianTransaction transaction ) { int count = 0 ; for ( SqlAction sqlAction : sqlActions ) { if ( ! ( sqlAction instanceof ISelect ) ) { count ++ ; } } return count > 1 || transaction . isBegun ( ) ; }
judge whether we need to begin the transaction . If there are more than one non - query sql actions in this dao unit a new transaction will be begun . if a transaction is already begun a nested transaction will be begun . Else no transaction will be begun .