Search found 171 matches

by JORGEMAL
Tue 31 Jan 2012 16:05
Forum: dotConnect for PostgreSQL
Topic: Using transaction commands directly instead of PgSqlTransact
Replies: 1
Views: 937

Using transaction commands directly instead of PgSqlTransact

Talking about transactions, is it possible to issue BEGIN, COMMIT, ROLLBACK commands instead of using PgSqlTransaction?

If so, what would be the advantage/disadvantage of issuing transaction command directly?

Respectfully,
Jorge Maldonado
by JORGEMAL
Mon 21 Nov 2011 23:24
Forum: dotConnect for PostgreSQL
Topic: Implicit transactions
Replies: 1
Views: 1218

Implicit transactions

PostgreSQL 9.0 documentation says the following about transactions:

"PostgreSQL actually treats every SQL statement as being executed within a transaction. If you do not issue a BEGIN command, then each individual statement has an implicit BEGIN and (if successful) COMMIT wrapped around it."

Does this apply for dotConnect for PostgreSQL provider?

Respectfully,
Jorge Maldonado
by JORGEMAL
Wed 26 Oct 2011 13:36
Forum: dotConnect for PostgreSQL
Topic: Problem with relations and System.Transactions
Replies: 6
Views: 1269

One reason I was using the TransactionScope class is that I need to leave one table out of the transaction which can be done setting the TransactionScopeOption to Supress. How can I achieve this goal using the PgSqlTransaction class?

I supposed that not sharing the connection with such a table, but openning and closing its own one, would solve my issue but it seems it does not. This table is used as an event log so I need to insert data weather or not the operation to the DB is successful. I threw an exception on purpose and nothing was registered in the log table.

Respectfully,
Jorge Maldonado
by JORGEMAL
Mon 24 Oct 2011 13:40
Forum: dotConnect for PostgreSQL
Topic: Problem with relations and System.Transactions
Replies: 6
Views: 1269

So, this means that it will not work this way (using the TransactionScope class). In this case, what is the solution? Should I use PgSqlTransaction class instead?

Thank you,
Jorge Maldonado
by JORGEMAL
Mon 17 Oct 2011 16:33
Forum: dotConnect for PostgreSQL
Topic: Problem with relations and System.Transactions
Replies: 6
Views: 1269

Problem with relations and System.Transactions

I am inserting records in 2 tables so I decided to use the TransactionScope class from the System.Transactions namesape. Firstly, I wrote my code without transactions to make sure it is working. Then, I added transactions and I am having a problem. The tables have a relation which is defined using a foreign key. Insertion takes place in the parent table first, and then continues inserting several records in the child table. As soon as it tries to insert the first child record I get an exception saying that there is a foreign key violation. It seems that the parent table record is not inserted immediately when transactions are used but until transaction is completed. Is this a question for you?

Respectfully,
Jorge Maldonado

Code: Select all

// **********************************************
// Calls insertion methods for parent and child tables.
// **********************************************
Protected void Insertion
    Boolean blnError = false;
    using (TransactionScope trnScope = new TransactionScope())
    {
        // Insertion in parent table.
        ParentTable objParentTable as new ParentTable();
        blnError = ParentTable.Insert();
        
        // Insertion in child table.
        if (!blnError)
        {
            ChildTable objChildTable = new ChildTable();
            blnError = ChildTable.Insert();
        }

        if (!blnError)
            trnScope.Complete();
    }

// **********************************************
// Parent and child table methods are part of a class library.
// **********************************************
protected Boolean ParentTable()
{
    // Insertion in the parent table takes place here.
    // The parent table has a serial field which is the primary key.
    // The insert command has a RETURNING clause to get such
    // a serial field which will be used by the ChildTable method.
    // I tested with and without TransactionScope here.
    // If an exception is caught then TRUE is returned, else FALSE is returned.
}

protected Boolean ChildTable()
{
    // Insertion in the child table takes place here.
    // The primary key, which is the value of the serial field generated
    // in the ParentTable() method, is used here to relate the child records
    // with the parent record. It seems that the parent record is not 
    // inserted yet, but until the transaction is completed.
    // I tested with and without TransactionScope here.
    // If an exception is caught then TRUE is returned, else FALSE is returned.
}

by JORGEMAL
Fri 07 Oct 2011 16:31
Forum: dotConnect for PostgreSQL
Topic: Problem with TransactionScopeOption.Suppress
Replies: 2
Views: 2726

MY BIG MISTAKE !!!
There was a syntax error I had not detected and it was causing the TransactionScopeOption.Suppress failure.
I apologize for any inconvenience this might have cause.

Respectfully,
Jorge Maldonado
by JORGEMAL
Mon 03 Oct 2011 15:20
Forum: dotConnect for PostgreSQL
Topic: Problem with TransactionScopeOption.Suppress
Replies: 2
Views: 2726

Problem with TransactionScopeOption.Suppress

I am using the System.Transactions Namespace but I need one table operation out of the transaction, so I defined a TransactionScope for it and set its TransactionScopeOption parameter to "Suppress" but it seems it does not work. Such a table is a PostgreSQL table used to insert logging data. I am throwing an exception in order to test this situation. After the process is finished, the tables involved in the transaction do not contain any records and the logging table does not have any new record added either. The logging table inserts a new record everytime an exception is thrown. Is there any issue supporting TransactionScopeOption.Suppress?
I am using dotConnect for PostgreSQL v5.10.111.0 and PostgreSQL v9.0.

Regards,
Jorge Maldonado
by JORGEMAL
Fri 05 Aug 2011 17:04
Forum: dotConnect for PostgreSQL
Topic: Provider can not decode password
Replies: 1
Views: 1045

I solved my issue. The "validationKey" and "decryptionKey" values included "isolateapps" as follows:

validationKey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, isolateapps"
decryptionKey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, isolateapps"

I removed it and everything worked just fine.

Regards,
Jorge Maldonado
by JORGEMAL
Fri 05 Aug 2011 16:24
Forum: dotConnect for PostgreSQL
Topic: Provider can not decode password
Replies: 1
Views: 1045

Provider can not decode password

I am developing a web site and I decided to split it in 2 sites. The original site uses a database which includes the membership tables. The new site must use the same database and the same users/roles. So, both web sites use a common database.
I created the new web site based on the original site, I copied some of the web forms to it and also the web.config file; now, both sites use the same web.config file which contains string connections, validation and decryption keys, etc.
When I try to validate my username and password I get an error message saying that "Provider can not decode password". Both, membership provider and role provider, have the "applicationName" property set to "/".
I will appreciate any help with this issue in case it has to do with dotConnect for PostgreSQL provider.

Respectfully,
Jorge Maldonado
by JORGEMAL
Wed 20 Jul 2011 14:24
Forum: dotConnect for PostgreSQL
Topic: Select statements of dataset created in the visual designer
Replies: 1
Views: 1071

Select statements of dataset created in the visual designer

I created a DataSet using the visual designer, it includes 2 DataTables with their DataAdapters, it also has a relation between the DataTables. The DataAdapters have their select statements which get data from the database, all this was done in the visual designer. I see that, in the visual designer, a property called SelectStatement has the definition for the select statement and what I need is to modify such a property at run time. In my code, I instantiate the DataSet and the DataAdapters and then issue the Fill method to load the information based on the select statement defined in the visual designer. I have looked for the SelectCommand property in order to change its content in code but I do not find it. Is this possible?

Respectfully,
Jorge Maldonado
by JORGEMAL
Fri 18 Mar 2011 14:48
Forum: dotConnect for PostgreSQL
Topic: Working with null dates
Replies: 4
Views: 1390

I appreciate your answer.
So, would PgSqlTimeStamp.Null be useful to set a NULL value to a date field?

Regards,
Jorge Maldonado
by JORGEMAL
Thu 17 Mar 2011 23:24
Forum: dotConnect for PostgreSQL
Topic: Working with null dates
Replies: 4
Views: 1390

Working with null dates

I have a table with a date field which can be null, such a table now has rows with valid date values and null values too. I need to build a query in C# to get all rows that have null values in the date field but I have not been able to achieve it. It is something like this:

strQuery = "SELECT * FROM sources WHERE src_date = NULL ORDER BY src_name"

I have tried using PgSqlTimeStamp.Null without success.
What is the correct way to write this query statement?

With respect,
Jorge Maldonado
by JORGEMAL
Wed 09 Mar 2011 14:57
Forum: dotConnect for PostgreSQL
Topic: PgSqlDump and pgAdmin III
Replies: 33
Views: 11868

I appreciate the support for this issue.
The test project you sent and my application were both run in the same machine. The only issue I had was when the schema was set in the connection string. There is no problem if the schema is defined in pgSqlDump schema property.

Best regards,
Jorge Maldonado
by JORGEMAL
Mon 07 Mar 2011 19:38
Forum: dotConnect for PostgreSQL
Topic: PgSqlDump and pgAdmin III
Replies: 33
Views: 11868

* Yes, both applications connect to the same DB and the connection string is the same.

* I do not understand what you mean with "both applications are run on the same machine".

* The Devart assemblies are the same for both, the development PC and the production server (5.10.111.0).

All of my tests indicate that the problem comes when the schema is set in the connection string. I performed such tests as the postgres user to make sure there are no privileges issues.

I have noticed that, when running the script in the SQL Editor to restore the dump that I got using pgSqlDump, my tables' privileges are missing. Is this feature not implemented?

Regards,
Jorge Maldonado
by JORGEMAL
Thu 03 Mar 2011 18:07
Forum: dotConnect for PostgreSQL
Topic: PgSqlDump and pgAdmin III
Replies: 33
Views: 11868

Yes, I could run the backup and restore operations with your test project provided the schema name is not set in the connection string.

I am going to perform additional tests in order to give you more information but I need to ask a question: when I get a backup using pgAdmin III, privileges and tablespaces are included; in the "Dump Options #1" tab, section "Don't save", I do not check the "Privilege" and "Tablespace" checkboxes. Are there any equivalent settings in pgSqlDmp class?

Regards,
Jorge Maldonado