﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21239	Closing connection inside atomic block breaks atomicity	marcin@…	Aymeric Augustin	"Closing the connection inside an atomic block rolls back queries up to that point, but doesn't prevent subsequent queries from reconnecting and getting committed. An exception should be raised in this situation in one of three places:
* connection.close()
* or on the next reconnection attempt
* or on the next query execution attempt

Testcase (currently failing):
{{{
def test_connection_closed_inside_atomic (self):
    with self.assertRaises(transaction.TransactionManagementError):
        with transaction.atomic():
            Reporter.objects.create(first_name=""Tom"")
            connection.close()
            Reporter.objects.create(first_name=""Jerry"")
        # here Jerry exists but Tom doesn't
}}}
"	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed	atomic close		Accepted	1	0	0	0	0	0
