Each invokation of db2_all (indeed, even each invokation of db2) spawns a separate shell; the connection is terminated when the first shell terminates. If you want to issue multiple commands I guess you should put them in a db2 script:
Code:
db2_all "<<+2<db2 -tf /path/to/my/script.db2