Unique Key Constraint Violations with MySQL

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Unique Key Constraint Violations with MySQL

David Frenkiel
Hello, All.

 

I just started evaluating OfBiz (with MySQL) and overall things are
going well.

 

The only issue I'm having is with unique key constraints on various
tables.

 

For example, when I hit the submit button a couple times quickly when
logging into the catalog manager, I get the following error:

 

---------------------

 

SQL Exception while executing the following:

 

INSERT INTO USER_LOGIN_HISTORY (USER_LOGIN_ID, VISIT_ID, FROM_DATE,
THRU_DATE, PARTY_ID, PASSWORD_USED, SUCCESSFUL_LOGIN,
LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP,
CREATED_TX_STAMP)

VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

 

Duplicate key or integrity constraint violation message from server:
Duplicate entry 'admin-2007-03-01 15:35:00' for key 1. Rolling back
transaction.

 

---------------------

 

The key appears to be composed of the username and the timestamp. And
since the timestamp is only granular to the second, I get a violation
when two requests come in too quickly.

 

I assume this is only a problem on MySQL. Besides dropping the primary
key from the table (or switching to Postgres) is there something simple
I can do to resolve this?

 

Thanks very much.

 

David Frenkiel

ShopText, Inc.

 

 

Reply | Threaded
Open this post in threaded view
|

Re: Unique Key Constraint Violations with MySQL

David E Jones

Are you saying you have a requirement to support a rapid succession  
of logins?

-David


On Mar 1, 2007, at 2:23 PM, David Frenkiel wrote:

> Hello, All.
>
>
>
> I just started evaluating OfBiz (with MySQL) and overall things are
> going well.
>
>
>
> The only issue I'm having is with unique key constraints on various
> tables.
>
>
>
> For example, when I hit the submit button a couple times quickly when
> logging into the catalog manager, I get the following error:
>
>
>
> ---------------------
>
>
>
> SQL Exception while executing the following:
>
>
>
> INSERT INTO USER_LOGIN_HISTORY (USER_LOGIN_ID, VISIT_ID, FROM_DATE,
> THRU_DATE, PARTY_ID, PASSWORD_USED, SUCCESSFUL_LOGIN,
> LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP,
> CREATED_TX_STAMP)
>
> VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
>
>
>
> Duplicate key or integrity constraint violation message from server:
> Duplicate entry 'admin-2007-03-01 15:35:00' for key 1. Rolling back
> transaction.
>
>
>
> ---------------------
>
>
>
> The key appears to be composed of the username and the timestamp. And
> since the timestamp is only granular to the second, I get a violation
> when two requests come in too quickly.
>
>
>
> I assume this is only a problem on MySQL. Besides dropping the primary
> key from the table (or switching to Postgres) is there something  
> simple
> I can do to resolve this?
>
>
>
> Thanks very much.
>
>
>
> David Frenkiel
>
> ShopText, Inc.
>
>
>
>
>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Unique Key Constraint Violations with MySQL

David Frenkiel
Hello, David.

No, I don't need rapid logins.

I've seen this issue also on the SERVER_HIT table.

For example,

SQL Exception while executing the following:INSERT INTO SERVER_HIT
(VISIT_ID, CONTENT_ID, HIT_START_DATE_TIME, HIT_TYPE_ID,
INTERNAL_CONTENT_ID, NUM_OF_BYTES, RUNNING_TIME_MILLIS, USER_LOGIN_ID,
PARTY_ID, STATUS_ID, REQUEST_URL, REFERRER_URL,
ID_BY_IP_CONTACT_MECH_ID, REF_BY_WEB_CONTACT_MECH_ID, SERVER_IP_ADDRESS,
SERVER_HOST_NAME, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Duplicate key or integrity constraint
violation message from server: "Duplicate entry
'10022-shoptext.images-2007-02-28 14:29:26-REQUEST' for key 1"))).
Rolling back transaction.

In this case, if the same image is referenced in an HTML page (a spacer
gif, for example) I'll see lot's of these exceptions.

Of course, if I put this into production I'm going to serve images
directly from the web server. So that'll sorta resolve it.

However, what if I have a SOAP service exposed? Will that also result in
writes to the SERVER_HIT table? And thus generate many of these
exceptions?

Perhaps it's not really a big deal but it certainly clutters up the
logs.

Thanks very much for the assistance.
David F.


-----Original Message-----
From: David E. Jones [mailto:[hidden email]]
Sent: Thursday, March 01, 2007 5:01 PM
To: [hidden email]
Subject: Re: Unique Key Constraint Violations with MySQL


Are you saying you have a requirement to support a rapid succession  
of logins?

-David


On Mar 1, 2007, at 2:23 PM, David Frenkiel wrote:

> Hello, All.
>
>
>
> I just started evaluating OfBiz (with MySQL) and overall things are
> going well.
>
>
>
> The only issue I'm having is with unique key constraints on various
> tables.
>
>
>
> For example, when I hit the submit button a couple times quickly when
> logging into the catalog manager, I get the following error:
>
>
>
> ---------------------
>
>
>
> SQL Exception while executing the following:
>
>
>
> INSERT INTO USER_LOGIN_HISTORY (USER_LOGIN_ID, VISIT_ID, FROM_DATE,
> THRU_DATE, PARTY_ID, PASSWORD_USED, SUCCESSFUL_LOGIN,
> LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP,
> CREATED_TX_STAMP)
>
> VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
>
>
>
> Duplicate key or integrity constraint violation message from server:
> Duplicate entry 'admin-2007-03-01 15:35:00' for key 1. Rolling back
> transaction.
>
>
>
> ---------------------
>
>
>
> The key appears to be composed of the username and the timestamp. And
> since the timestamp is only granular to the second, I get a violation
> when two requests come in too quickly.
>
>
>
> I assume this is only a problem on MySQL. Besides dropping the primary
> key from the table (or switching to Postgres) is there something  
> simple
> I can do to resolve this?
>
>
>
> Thanks very much.
>
>
>
> David Frenkiel
>
> ShopText, Inc.
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Setting Up Access to Multiple Stores

David Frenkiel
In reply to this post by David E Jones
A question about configuring stores...

I'd like to set up multiple stores and allow clients to administrate
certain aspects of their respective stores and catalogs.

So, for example, suppose I were selling products on behalf of two
different vendors.

Could I set up user accounts for each so that they could log into OfBiz
and set up their catalogs (but have access to nothing else)?

I'm just wondering if there's a way I can set this up using the various
role and security settings in the party manager and catalog manager
applications.

Thanks.
David F.

Reply | Threaded
Open this post in threaded view
|

Re: Setting Up Access to Multiple Stores

Ashish Vijaywargiya-3
Party --> Security section will help you.

On 3/2/07, David Frenkiel <[hidden email]> wrote:

>
> A question about configuring stores...
>
> I'd like to set up multiple stores and allow clients to administrate
> certain aspects of their respective stores and catalogs.
>
> So, for example, suppose I were selling products on behalf of two
> different vendors.
>
> Could I set up user accounts for each so that they could log into OfBiz
> and set up their catalogs (but have access to nothing else)?
>
> I'm just wondering if there's a way I can set this up using the various
> role and security settings in the party manager and catalog manager
> applications.
>
> Thanks.
> David F.
>
>


--
Regards
Ashish Vijaywargiya
Aditisoft Technology Laboratory
http://www.adititechlabs.com

Office : 509.855.4113
Cell    : 91-989-347-9711