protected String getCurrentThreadId ( ) { String attach_id = ( String ) ThreadSession . getValue ( getThreadSessionKey ( ) ) ; if ( attach_id != null ) return attach_id ; Thread thread = Thread . currentThread ( ) ; return thread . toString ( ) + "(" + thread . hashCode ( ) + ")" ; }
Retrieve the current thread id for use by the transaction code .