You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Anshuman Manur <an...@stragure.com> on 2009/05/15 08:04:21 UTC

help maintaining consistency of database with code

Hey,

We're three developers working on building an e-commerce store with ofbiz.
For code sharing and versioning, we've setup a SVN server on a local LAN
machine. We're using a MySQL database ver 5.0. What we usually do is when we
make changes that affect the DB, (such as adding new products) we take a
mysql dump of the db and version the file on the SVN server. The developer
checking out code gets the .sql file and updates his DB. But I notice this
strange error in the logs:

Exception: org.ofbiz.entity.GenericDataSourceException
Message: SQL Exception while executing the following:INSERT INTO SERVER_HIT
(VISIT_ID, CONTENT_ID, HIT_START_DATE_TIME, HIT_TYPE_ID, NUM_OF_BYTES,
RUNNING_TIME_MILLIS, USER_LOGIN_ID, STATUS_ID, REQUEST_URL, REFERRER_URL,
SERVER_IP_ADDRESS, SERVER_HOST_NAME, LAST_UPDATED_STAMP,
LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP, INTERNAL_CONTENT_ID,
PARTY_ID, ID_BY_IP_CONTACT_MECH_ID, REF_BY_WEB_CONTACT_MECH_ID) VALUES (?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Cannot add or
update a child row: a foreign key constraint fails (`xsport/SERVER_HIT`,
CONSTRAINT `SERVER_HIT_VISIT` FOREIGN KEY (`VISIT_ID`) REFERENCES `VISIT`
(`VISIT_ID`)))

Every hit to the server gives this error. I know this is not normal and I
was wondering if this is caused because we abruptly change the db's state
whenever we check-out from the repo, and the db is somehow out of sync with
the servelt engine. Also, any better ways for code sharing and db
consistency? I'd love to hear what everyone thinks.

Thanks,
Anshuman Manur

Re: help maintaining consistency of database with code

Posted by Jacques Le Roux <ja...@les7arts.com>.
You may neglict such errors, it's related to local context not being consistent with the dump, that's all

Jacques

From: "Anshuman Manur" <an...@stragure.com>
> Hey,
> 
> We're three developers working on building an e-commerce store with ofbiz.
> For code sharing and versioning, we've setup a SVN server on a local LAN
> machine. We're using a MySQL database ver 5.0. What we usually do is when we
> make changes that affect the DB, (such as adding new products) we take a
> mysql dump of the db and version the file on the SVN server. The developer
> checking out code gets the .sql file and updates his DB. But I notice this
> strange error in the logs:
> 
> Exception: org.ofbiz.entity.GenericDataSourceException
> Message: SQL Exception while executing the following:INSERT INTO SERVER_HIT
> (VISIT_ID, CONTENT_ID, HIT_START_DATE_TIME, HIT_TYPE_ID, NUM_OF_BYTES,
> RUNNING_TIME_MILLIS, USER_LOGIN_ID, STATUS_ID, REQUEST_URL, REFERRER_URL,
> SERVER_IP_ADDRESS, SERVER_HOST_NAME, LAST_UPDATED_STAMP,
> LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP, INTERNAL_CONTENT_ID,
> PARTY_ID, ID_BY_IP_CONTACT_MECH_ID, REF_BY_WEB_CONTACT_MECH_ID) VALUES (?,
> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Cannot add or
> update a child row: a foreign key constraint fails (`xsport/SERVER_HIT`,
> CONSTRAINT `SERVER_HIT_VISIT` FOREIGN KEY (`VISIT_ID`) REFERENCES `VISIT`
> (`VISIT_ID`)))
> 
> Every hit to the server gives this error. I know this is not normal and I
> was wondering if this is caused because we abruptly change the db's state
> whenever we check-out from the repo, and the db is somehow out of sync with
> the servelt engine. Also, any better ways for code sharing and db
> consistency? I'd love to hear what everyone thinks.
> 
> Thanks,
> Anshuman Manur
>


Re: help maintaining consistency of database with code

Posted by Anshuman Manur <an...@stragure.com>.
I should probably mention that I did not load the demo store data (ant
target: run-install). I used run-install-seed which loads only the seed
data. I don't know if this causes this issue.


On Fri, May 15, 2009 at 11:34 AM, Anshuman Manur <
anshuman_manur@stragure.com> wrote:

> Hey,
>
> We're three developers working on building an e-commerce store with ofbiz.
> For code sharing and versioning, we've setup a SVN server on a local LAN
> machine. We're using a MySQL database ver 5.0. What we usually do is when we
> make changes that affect the DB, (such as adding new products) we take a
> mysql dump of the db and version the file on the SVN server. The developer
> checking out code gets the .sql file and updates his DB. But I notice this
> strange error in the logs:
>
> Exception: org.ofbiz.entity.GenericDataSourceException
> Message: SQL Exception while executing the following:INSERT INTO SERVER_HIT
> (VISIT_ID, CONTENT_ID, HIT_START_DATE_TIME, HIT_TYPE_ID, NUM_OF_BYTES,
> RUNNING_TIME_MILLIS, USER_LOGIN_ID, STATUS_ID, REQUEST_URL, REFERRER_URL,
> SERVER_IP_ADDRESS, SERVER_HOST_NAME, LAST_UPDATED_STAMP,
> LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP, INTERNAL_CONTENT_ID,
> PARTY_ID, ID_BY_IP_CONTACT_MECH_ID, REF_BY_WEB_CONTACT_MECH_ID) VALUES (?,
> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Cannot add or
> update a child row: a foreign key constraint fails (`xsport/SERVER_HIT`,
> CONSTRAINT `SERVER_HIT_VISIT` FOREIGN KEY (`VISIT_ID`) REFERENCES `VISIT`
> (`VISIT_ID`)))
>
> Every hit to the server gives this error. I know this is not normal and I
> was wondering if this is caused because we abruptly change the db's state
> whenever we check-out from the repo, and the db is somehow out of sync with
> the servelt engine. Also, any better ways for code sharing and db
> consistency? I'd love to hear what everyone thinks.
>
> Thanks,
> Anshuman Manur
>

Re: help maintaining consistency of database with code

Posted by Anshuman Manur <an...@stragure.com>.
So, I will safely ignore these errors then! Thank you for your replies!

On Fri, May 15, 2009 at 1:34 PM, Jacques Le Roux <
jacques.le.roux@les7arts.com> wrote:

> Right, and ?
>
> Jacques
>
> From: "abdullah shaikh" <ab...@viithiisys.com>
>
>  You can have a look at this
>> https://issues.apache.org/jira/browse/OFBIZ-2208
>>
>>
>> On Fri, May 15, 2009 at 11:34 AM, Anshuman Manur <
>> anshuman_manur@stragure.com> wrote:
>>
>>  Hey,
>>>
>>> We're three developers working on building an e-commerce store with
>>> ofbiz.
>>> For code sharing and versioning, we've setup a SVN server on a local LAN
>>> machine. We're using a MySQL database ver 5.0. What we usually do is when
>>> we
>>> make changes that affect the DB, (such as adding new products) we take a
>>> mysql dump of the db and version the file on the SVN server. The
>>> developer
>>> checking out code gets the .sql file and updates his DB. But I notice
>>> this
>>> strange error in the logs:
>>>
>>> Exception: org.ofbiz.entity.GenericDataSourceException
>>> Message: SQL Exception while executing the following:INSERT INTO
>>> SERVER_HIT
>>> (VISIT_ID, CONTENT_ID, HIT_START_DATE_TIME, HIT_TYPE_ID, NUM_OF_BYTES,
>>> RUNNING_TIME_MILLIS, USER_LOGIN_ID, STATUS_ID, REQUEST_URL, REFERRER_URL,
>>> SERVER_IP_ADDRESS, SERVER_HOST_NAME, LAST_UPDATED_STAMP,
>>> LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP,
>>> INTERNAL_CONTENT_ID,
>>> PARTY_ID, ID_BY_IP_CONTACT_MECH_ID, REF_BY_WEB_CONTACT_MECH_ID) VALUES
>>> (?,
>>> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Cannot add or
>>> update a child row: a foreign key constraint fails (`xsport/SERVER_HIT`,
>>> CONSTRAINT `SERVER_HIT_VISIT` FOREIGN KEY (`VISIT_ID`) REFERENCES `VISIT`
>>> (`VISIT_ID`)))
>>>
>>> Every hit to the server gives this error. I know this is not normal and I
>>> was wondering if this is caused because we abruptly change the db's state
>>> whenever we check-out from the repo, and the db is somehow out of sync
>>> with
>>> the servelt engine. Also, any better ways for code sharing and db
>>> consistency? I'd love to hear what everyone thinks.
>>>
>>> Thanks,
>>> Anshuman Manur
>>>
>>>
>>
>>
>> --
>> Regards,
>>
>> Abdullah Shaikh
>> Viithiisys
>>
>>
>

Re: help maintaining consistency of database with code

Posted by Jacques Le Roux <ja...@les7arts.com>.
Right, and ?

Jacques

From: "abdullah shaikh" <ab...@viithiisys.com>
> You can have a look at this https://issues.apache.org/jira/browse/OFBIZ-2208
> 
> 
> On Fri, May 15, 2009 at 11:34 AM, Anshuman Manur <
> anshuman_manur@stragure.com> wrote:
> 
>> Hey,
>>
>> We're three developers working on building an e-commerce store with ofbiz.
>> For code sharing and versioning, we've setup a SVN server on a local LAN
>> machine. We're using a MySQL database ver 5.0. What we usually do is when
>> we
>> make changes that affect the DB, (such as adding new products) we take a
>> mysql dump of the db and version the file on the SVN server. The developer
>> checking out code gets the .sql file and updates his DB. But I notice this
>> strange error in the logs:
>>
>> Exception: org.ofbiz.entity.GenericDataSourceException
>> Message: SQL Exception while executing the following:INSERT INTO SERVER_HIT
>> (VISIT_ID, CONTENT_ID, HIT_START_DATE_TIME, HIT_TYPE_ID, NUM_OF_BYTES,
>> RUNNING_TIME_MILLIS, USER_LOGIN_ID, STATUS_ID, REQUEST_URL, REFERRER_URL,
>> SERVER_IP_ADDRESS, SERVER_HOST_NAME, LAST_UPDATED_STAMP,
>> LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP,
>> INTERNAL_CONTENT_ID,
>> PARTY_ID, ID_BY_IP_CONTACT_MECH_ID, REF_BY_WEB_CONTACT_MECH_ID) VALUES (?,
>> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Cannot add or
>> update a child row: a foreign key constraint fails (`xsport/SERVER_HIT`,
>> CONSTRAINT `SERVER_HIT_VISIT` FOREIGN KEY (`VISIT_ID`) REFERENCES `VISIT`
>> (`VISIT_ID`)))
>>
>> Every hit to the server gives this error. I know this is not normal and I
>> was wondering if this is caused because we abruptly change the db's state
>> whenever we check-out from the repo, and the db is somehow out of sync with
>> the servelt engine. Also, any better ways for code sharing and db
>> consistency? I'd love to hear what everyone thinks.
>>
>> Thanks,
>> Anshuman Manur
>>
> 
> 
> 
> -- 
> Regards,
> 
> Abdullah Shaikh
> Viithiisys
>


Re: help maintaining consistency of database with code

Posted by abdullah shaikh <ab...@viithiisys.com>.
You can have a look at this https://issues.apache.org/jira/browse/OFBIZ-2208


On Fri, May 15, 2009 at 11:34 AM, Anshuman Manur <
anshuman_manur@stragure.com> wrote:

> Hey,
>
> We're three developers working on building an e-commerce store with ofbiz.
> For code sharing and versioning, we've setup a SVN server on a local LAN
> machine. We're using a MySQL database ver 5.0. What we usually do is when
> we
> make changes that affect the DB, (such as adding new products) we take a
> mysql dump of the db and version the file on the SVN server. The developer
> checking out code gets the .sql file and updates his DB. But I notice this
> strange error in the logs:
>
> Exception: org.ofbiz.entity.GenericDataSourceException
> Message: SQL Exception while executing the following:INSERT INTO SERVER_HIT
> (VISIT_ID, CONTENT_ID, HIT_START_DATE_TIME, HIT_TYPE_ID, NUM_OF_BYTES,
> RUNNING_TIME_MILLIS, USER_LOGIN_ID, STATUS_ID, REQUEST_URL, REFERRER_URL,
> SERVER_IP_ADDRESS, SERVER_HOST_NAME, LAST_UPDATED_STAMP,
> LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP,
> INTERNAL_CONTENT_ID,
> PARTY_ID, ID_BY_IP_CONTACT_MECH_ID, REF_BY_WEB_CONTACT_MECH_ID) VALUES (?,
> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Cannot add or
> update a child row: a foreign key constraint fails (`xsport/SERVER_HIT`,
> CONSTRAINT `SERVER_HIT_VISIT` FOREIGN KEY (`VISIT_ID`) REFERENCES `VISIT`
> (`VISIT_ID`)))
>
> Every hit to the server gives this error. I know this is not normal and I
> was wondering if this is caused because we abruptly change the db's state
> whenever we check-out from the repo, and the db is somehow out of sync with
> the servelt engine. Also, any better ways for code sharing and db
> consistency? I'd love to hear what everyone thinks.
>
> Thanks,
> Anshuman Manur
>



-- 
Regards,

Abdullah Shaikh
Viithiisys