# SQLConnection causes kernel hangs

This question is additional question to Maintaining SQLConnections In Mathematica 10.4.1.0 (64bit).

<< DatabaseLinkDatabaseExamples
DatabaseExamplesBuild[]
Needs["DatabaseLink"]
t1 := RunScheduledTask[t2; RemoveScheduledTask[$ScheduledTask], {1}] t1  after executing t1 every expression is executed fully, so t1,t2,maintainConnection and $ScheduledTask is removed after it finishes, but kernel stays hanging, and only way is to Quit kernel. The way to avoid this is to assign conn = OpenSQLConnection["demo"] prior the calling ScheduledTask, so prior executing t1, and after this subsequently call t2 via Scheduling as needed. This is most simple example, that, as exposed seem does not have sense, but in complicated where one scheduled task is initiated in another, it does, and in that situation conn = OpenSQLConnection["demo"] should be avoided, as a call outside of t1, or another ScheduledTask. In Mathematica 11.3 this does not cause kernel hangs.