{ "info": { "author": "Jim Fulton", "author_email": "jim@jimfulton.info", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Buildout", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "=====================================\npsycopg2 integration with transaction\n=====================================\n\nThis package provides two-phase commit integration between psycopg2\nand the transaction package.\n\nSample usage::\n\n >>> import psycopg2, psycopg2transaction, transaction\n\n >>> conn = psycopg2.connect(mydsn)\n >>> trans = transaction.get()\n >>> psycopg2transaction.join(conn, trans)\n\n >>> ... do things with the psycopg2 connection\n\n >>> transaction.commit()\n\nThis is just an example. The connection might come from a pool or\notherwise already exist, as long as it is in a `suitable state to start\na distributed transaction\n`_.\n\nSimilarly, the transaction may come from the thread-local transaction\nmanager, as shown above, or from an application-managed transaction\nmanager.\n\nThe critical line in the example above is::\n\n >>> psycopg2transaction.join(conn, trans)\n\nThe work done in the connection is committed by calling the\ntransaction's commit method, typically by calling ``commit`` on the\ntransaction's manager, as shown above.\n\nIf you use a thread-local transaction manager (as in the example\nabove), you can omit the transaction argumet to ``join``::\n\n >>> psycopg2transaction.join(conn)\n\nConnection management\n=====================\n\nLimited connection management is provided::\n\n >>> dsn = 'dbname=test'\n >>> conn = psycopg2transaction.join(dsn)\n ...\n >>> conn = psycopg2transaction.join(dsn)\n ...\n >>> transaction.commit()\n\nIf you pass a connection string rather than a connection to ``join``, a\nconnection will be opened for you and closed when the transaction is\ncommitted. If ``join`` is called multiple times with the same connection\nstring, then the same connection is used and returned.\n\nUsing Postgres notify\n=====================\n\nYou can't use two-phase commit in postgres transactions in which\nyou've used NOTIFY (or LISTEN or UNLISTEN). You can cause NOTIFY to\nbe used after a transaction has committed, but before a managed\nconnection has been closed by passing a ``notify`` argument to join\nwith a name of a notification or a sequence of string notification\nnamed. The strings may be simple names, or names followed by a comma\nand string data, as would follow NOTIFY in a notify expression::\n\n >>> conn = psycopg2transaction.join(dsn, notify='myjobs')\n\n=======\nChanges\n=======\n\n0.1.1 (2017-03-18)\n==================\n\n- Package meta data.\n\n\n0.1.0 (2017-03-18)\n==================\n\nInitial release", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jimfulton/psycopg2transaction", "keywords": "psycopg2,transaction,postgres,database", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "psycopg2transaction", "package_url": "https://pypi.org/project/psycopg2transaction/", "platform": "", "project_url": "https://pypi.org/project/psycopg2transaction/", "project_urls": { "Homepage": "https://github.com/jimfulton/psycopg2transaction" }, "release_url": "https://pypi.org/project/psycopg2transaction/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "psycopg2 integration with transaction", "version": "0.1.1" }, "last_serial": 2715099, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "0fe340baa68aeb7c1befd3ff035b9667", "sha256": "7bab2b1488b6efc0908f82ce5ffa74d38170454273e12369f0222c79543088f7" }, "downloads": -1, "filename": "psycopg2transaction-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0fe340baa68aeb7c1befd3ff035b9667", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4656, "upload_time": "2017-03-18T22:52:14", "url": "https://files.pythonhosted.org/packages/6d/55/f0b8df770781ef3d7fed5c51a317ea4a9389d8041886f2a71ee3bfdadb91/psycopg2transaction-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "c3d62a2a80f1c6be3683cb4d0ca44919", "sha256": "ffe007666c782860b09999eaf04e4b60d2045b80146a696be162dbb860a0d9ac" }, "downloads": -1, "filename": "psycopg2transaction-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c3d62a2a80f1c6be3683cb4d0ca44919", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4747, "upload_time": "2017-03-18T23:00:41", "url": "https://files.pythonhosted.org/packages/39/fc/82d72616ee2974711fa5fb313a7198d5a38c087271b92ef3c878767c0f75/psycopg2transaction-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c3d62a2a80f1c6be3683cb4d0ca44919", "sha256": "ffe007666c782860b09999eaf04e4b60d2045b80146a696be162dbb860a0d9ac" }, "downloads": -1, "filename": "psycopg2transaction-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c3d62a2a80f1c6be3683cb4d0ca44919", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4747, "upload_time": "2017-03-18T23:00:41", "url": "https://files.pythonhosted.org/packages/39/fc/82d72616ee2974711fa5fb313a7198d5a38c087271b92ef3c878767c0f75/psycopg2transaction-0.1.1.tar.gz" } ] }