Re: autocommit feature in pgadmin

From: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
To: Sanket Mehta <sanket(dot)mehta(at)enterprisedb(dot)com>, Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: autocommit feature in pgadmin
Date: 2015-04-07 05:32:08
Message-ID: CAG7mmowM9NZ18j-Y9QhobdZ=qQf=W=3u52h+e3EMfrvrDL-a4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Wed, Apr 1, 2015 at 2:31 PM, Sanket Mehta <sanket(dot)mehta(at)enterprisedb(dot)com>
wrote:

> Hi,
>
> I have made all the changes mentioned in below mail.
> Along with that I have changed the code to read autoRollBack value in
> pgadmin/frm/frmQuery.cpp file.
>
> previously it was used "settings->Read(wxT("frmQuery/AutoRollBack"),
> &bVal, true)" directly.
>
> Now I have changed it to settings->GetAutoRollBack() which is defined in
> sysSettings class.
>
> I have attached the new patch with this mail.
> Please review it and do the needful.
>
Hi Sanket,

I was just thinking a scenario:

Let's see a user has disabled AutoCommit off.
That means (as per your patch), BEGIN statement is appended/executed before
running any other statement requested by the user (if required).
Now - after executing some statement the user has changed the AutoCommit to
on.
But - it will be still in transaction unless user executes the
COMMIT/ROLLBACK/END, right?

Dave,

Do you think, we should give notice/message to the user that he/she needs
to execute either of the above in order to enable the AUTOCOMMIT on in
effect?

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company
<http://www.enterprisedb.com/>

*http://www.linkedin.com/in/asheshvashi*
<http://www.linkedin.com/in/asheshvashi>

>
>
>
> Regards,
> Sanket Mehta
> Sr Software engineer
> Enterprisedb
>
> On Tue, Mar 31, 2015 at 9:43 PM, Ashesh Vashi <
> ashesh(dot)vashi(at)enterprisedb(dot)com> wrote:
>
>> Hi Sanket,
>>
>> In your patch, I see couple of issues with your patch:
>> 1. In pgadmin/frm/frmQuery.cpp:
>> You've used "settings->Read(wxT("frmQuery/AutoCommit"), &bVal, true)"
>> directly.
>> You should be using the function, you've defined in sysSettings.
>> i.e.
>> sysSettings::GetAutoCommit()
>> and, sysSettings::SetAutoCommit()
>>
>> Please follow the correct naming convention for the
>> frmQuery::CommandNoBegin(...) function.
>> Function must not start with a capital letter for a regular function (we
>> do declare/define only the event functions with capital letters).
>>
>> 2. In pgadmin/ui/frmOptions.xrc:
>> A lot of changes are in this patch, which not required for this feature.
>>
>> --
>>
>> Thanks & Regards,
>>
>> Ashesh Vashi
>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>> <http://www.enterprisedb.com>
>>
>>
>> *http://www.linkedin.com/in/asheshvashi*
>> <http://www.linkedin.com/in/asheshvashi>
>>
>> On Tue, Mar 24, 2015 at 6:01 PM, Sanket Mehta <
>> sanket(dot)mehta(at)enterprisedb(dot)com> wrote:
>>
>>> Hi,
>>>
>>> Below is the description of the autocommit feature implementation in
>>> pgadmin:
>>>
>>> This feature is only applicable in query editor.
>>>
>>> Autocommit can be set on/off from 2 places.
>>>
>>> 1. pgadmin main browser -> File menu -> Options -> Query tool -> Query
>>> editor -> Enable Auto commit
>>> 2. In Query editor -> Query menu -> Auto-commmit
>>>
>>> By default auto commit will be enabled in pgadmin.
>>>
>>>
>>> In any query editor session, once user uncheck this autocommit checkbox,
>>> depending upon postgreSQL standard for executing the query it will execute
>>> "BEGIN;" statement before executing the actual query and thus setting the
>>> autocommit off for that session.
>>>
>>> User can set the autocommit on at any time by selecting the checkbox
>>> from above mentioned places.
>>> But it will be active only after user has completed the transaction
>>> block(started by BEGIN as mentioned above) by END or ROLLBACK or COMMIT;
>>>
>>> Let me know in case of any queries.
>>>
>>> Regards,
>>> Sanket Mehta
>>> Sr Software engineer
>>> Enterprisedb
>>>
>>
>>
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Sanket Mehta 2015-04-07 06:08:42 Re: autocommit feature in pgadmin
Previous Message Mehmet Emin KARAKAŞ 2015-04-06 14:00:45 Re: PgAgent Patch