[Mailman-Developers] Unable to commit changes from mailman shell to database

Barry Warsaw barry at list.org
Sat Apr 2 15:44:26 EDT 2016


On Apr 02, 2016, at 06:17 AM, Anirudh Dahiya wrote:

>I have been playing with mailman shell but upon creating objects like
>domains and addresses, and subsequestly committing them to database by
>calling transaction.commit() I am unable to see changes in the database(and
>thus on Postorius)

>The current approach I am taking towards committing transaction is first
>creating a connection object by calling config.db.engine.connect() . After
>that, I am creating a transaction object by calling connection.begin() .
>Finally after creating domain and address objects, I call
>transaction.commit(),which executes succesfully, but I am unable to see
>changes being reflected in the database.

Which database backend are you using, SQLite or PostgreSQL?

When you're checking the database, is this from a different process?   How are
you checking the database?  Can you give us the exact set of commands you're
using both to change things and to check things?  E.g. maybe paste a console
session so we can reproduce it.

`mailman shell` exposes some globals, such as commit(), abort(), the config
object, and the mailing list `m` object if you gave the -l option.  I don't
think you normally need to do the config.db.engine.connect() call or the
connection.begin() call, and I don't know whether those are create
subtransactions or otherwise interfering with your operations.

Cheers,
-Barry


More information about the Mailman-Developers mailing list