Discussion

Database save failed: Tried an insert, then tried

Hi,

I am getting the following error 'Database save failed: Tried an insert, then tried an update.' when i am trying to save using obj-save to an external DB. All the mandatory fields are supplied for this activity.

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

May 18, 2011 - 4:49pm

Hi,
I am also getting the same error.
So here is my assumption for why we are getting this error: When we do Obj-Save, Pega internally generates the SQL using the properties of the page which we are trying to save. And as we all know there will be addition properties on any page which pega uses for internal purpose. And since external table won't have columns like pzInsKey or pxObjClass, the query is failing.

I am not sure what will be the solution of this issue. But for the sake of finishing my task, I used RDB-Save instead of Obj-Save here. I know that will affect the performance but I had to move on :-(

If anyone is aware of the solution please post it. Thanks in advance ! ! !

Thanks,
Vivek Rathod

May 18, 2011 - 5:02pm

Hello Vivek,

Thats good that RDB-Save worked for you;

We are using DB2; When i googled the exception details(from log) some forums mentioned that some columns are missing;

When i looked at the TABLE script everything looks fine except some column names are in lower case; (which doesn't make any sense)

So i deleted the object and recreated it with all UPPERCASE; and flushed out all the cache at server and client level;
Amazingly the error stopped;

There was no change to script except the case; A

If possible give this a shot and let us know.

Thanks
PEGABOX19

August 3, 2011 - 5:53am

we faced similar issue and resolved it by increased the DB Table space and cleaning out the WO and Histtory tables.

Let me know if its able to resolve your issue.

-- Bala

August 3, 2011 - 6:57am

This generally happens when the properties are in a different case and the create script of the table had the column name in a different case. You can either drop the table and recreate it or use the external mapping tab in the class form to indicate the mapping between properties and columns.

May 6, 2011 - 9:55am

Hi Maheedhark;

Any update on this issue; I am struck up with similar issue;

PEGABOX19

April 15, 2014 - 1:54am

Check if you updated the database table after saving the class. If so, it helps resaving the class once. It worked for me

April 15, 2014 - 2:13am

BTW, I added pzPVStream in the table before I did the resave of my class.

The problem is - pzStatus property exists on the page I am trying to save. It does not have a corresponding field in my table. So, it did not allow me to save the instance. Once I added pzPVStream as a blob column, PRPC is saving the page.

August 13, 2015 - 3:11am

This issue occurred for me as well.

Then I tried to insert manually data into the table and identified that i was  not having sufficient privileges and also  table space for my table.

Grant priveleges using below command.

Grant ALL ON Tablename TO PUBLIC;
 

Granted table space using below command

ALTER USER <USER_NAME> QUOTA 100M ON USERS;