Hi jwrite,
For this purpose, a session ends (and the table is dropped) when the connection to the database is closed.
Using the CLI as an example.
db2
connect to mydatabase -- session starts
declare global temporary table session.mytable (id integer)
-- miscellaneous commands
terminate -- session ends
The table should exists as long as the client program (the CLI in this example) maintains a connection to the database.
Kent