The Allocate configuration property determines when a connection should be deallocated from the host server as follows:
If Allocate is set to connect, the connection is kept until the client issues some type of deallocation.
If Allocate is set to request, the connection is established at the start of a request, and then dropped.
Allocate does not affect the transaction mode.
If Allocate is set to request and the transaction mode is long, the connection stays available until a batch ends on a commit or rollback statement or exit:
If the batch ends on a commit or rollback statement, the transaction ends properly.
If the batch ends with exit, the connection also ends and any uncommitted SQL statements are rolled back.
If Allocate is set to request and the transaction mode is short, after the request is processed, all SQL statements in the request are committed and the connection is dropped. If the request ends with a rollback statement, the SQL statements in the request are rolled back and the connection is dropped.
If Allocate is set to request, the transaction mode is short, and a begin transaction is encountered in the request, the SQL statements to that point are committed. The connection stays open, and the transaction mode is set to temporary long. When a commit or rollback statement is encountered, the transaction mode reverts to short, and the allocation reverts to request.
While in temporary long transaction mode, the connection stays open until the transaction ends, even if the transaction spans multiple requests. The Allocate on request is ignored until the transaction ends.