Hi,

i am able to connect to ofbiz with demo data after doing modification
suggested.

but i am not able to add product.

i am getting below error -->

 The Following Errors Occurred:

Error: Error trying to begin transaction, could not process method: The
current transaction is marked for rollback, not beginning a new transaction
and aborting current operation; the rollbackOnly was caused by: Failure in
create operation for entity [ProductDimension]:
org.ofbiz.entity.GenericEntityException: Error while inserting:
[GenericEntity:ProductDimension][brandName,null()][createdStamp,2009-09-04
19:05:12.577(java.sql.Timestamp)][createdTxStamp,2009-09-04
19:05:11.797(java.sql.Timestamp)][dimensionId,10003(java.lang.String)][internalName,A
Beautifull Mind(java.lang.String)][lastUpdatedStamp,2009-09-04
19:05:12.577(java.sql.Timestamp)][lastUpdatedTxStamp,2009-09-04
19:05:11.797(java.sql.Timestamp)][productId,BHV1(java.lang.String)][productType,Finished
Good(java.lang.String)] (SQL Exception while executing the following:INSERT
INTO OFBIZ.PRODUCT_DIMENSION (DIMENSION_ID, PRODUCT_ID, PRODUCT_TYPE,
BRAND_NAME, INTERNAL_NAME, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) (The
statement was aborted because it would have caused a duplicate key value in
a unique or primary key constraint or unique index identified by
'SQL090811123924980' defined on 'PRODUCT_DIMENSION'.)). Rolling back
transaction.org.ofbiz.entity.GenericEntityException: Error while inserting:
[GenericEntity:ProductDimension][brandName,null()][createdStamp,2009-09-04
19:05:12.577(java.sql.Timestamp)][createdTxStamp,2009-09-04
19:05:11.797(java.sql.Timestamp)][dimensionId,10003(java.lang.String)][internalName,A
Beautifull Mind(java.lang.String)][lastUpdatedStamp,2009-09-04
19:05:12.577(java.sql.Timestamp)][lastUpdatedTxStamp,2009-09-04
19:05:11.797(java.sql.Timestamp)][productId,BHV1(java.lang.String)][productType,Finished
Good(java.lang.String)] (SQL Exception while executing the following:INSERT
INTO OFBIZ.PRODUCT_DIMENSION (DIMENSION_ID, PRODUCT_ID, PRODUCT_TYPE,
BRAND_NAME, INTERNAL_NAME, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) (The
statement was aborted because it would have caused a duplicate key value in
a unique or primary key constraint or unique index identified by
'SQL090811123924980' defined on 'PRODUCT_DIMENSION'.)) (Error while
inserting:
[GenericEntity:ProductDimension][brandName,null()][createdStamp,2009-09-04
19:05:12.577(java.sql.Timestamp)][createdTxStamp,2009-09-04
19:05:11.797(java.sql.Timestamp)][dimensionId,10003(java.lang.String)][internalName,A
Beautifull Mind(java.lang.String)][lastUpdatedStamp,2009-09-04
19:05:12.577(java.sql.Timestamp)][lastUpdatedTxStamp,2009-09-04
19:05:11.797(java.sql.Timestamp)][productId,BHV1(java.lang.String)][productType,Finished
Good(java.lang.String)] (SQL Exception while executing the following:INSERT
INTO OFBIZ.PRODUCT_DIMENSION (DIMENSION_ID, PRODUCT_ID, PRODUCT_TYPE,
BRAND_NAME, INTERNAL_NAME, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) (The
statement was aborted because it would have caused a duplicate key value in
a unique or primary key constraint or unique index identified by
'SQL090811123924980' defined on 'PRODUCT_DIMENSION'.)))   calling service
addProductToCategory in createProductInCategory



does the changes suggested below is the culprit ?


Plz guide.


Thanks,


Abhijeet Pandey


On Mon, Aug 31, 2009 at 5:42 AM, weixuezhang <weixuezh...@hotmail.com>wrote:

>  Either demo data or entitymodel definition has problem. Can someone look
> into this problem?
>
> I found 6 places with unique="true" in trunk as below. I simply changed
> "true" into "false", then started from creating a new database.
>
>  accounting\entitydef\entitymodel.xml
> 1,931: <index name="GLACCT_UNQCD" unique="true">
>
>  marketing\entitydef\entitymodel.xml
> 216: <index name="CNTLSTCST_MSG_ID" unique="true">
>
>  party\entitydef\entitymodel.xml (2 matches)
> 714: <index name="COMMEVT_MSG_ID" unique="true">
> 1,007: <index name="EMAIL_VERIFY_HASH" unique="true">
>
>  product\entitydef\entitymodel.xml (2 matches)
> 1,839: <index name="INVITEM_SOFID" unique="true">
> 1,842: <index name="INVITEM_ACTNM" unique="true">
>
> I found demo data doesn't specify value for some of these fields, default
> value of them is null. When inserting multiple records of data, demo data
> seeding will get failure due to the unique index constrain.
>
> Thanks.
> Weixue Zhang
>
> ------------------------------
> *发件人:* Abhijeet Pandey
> *发送时间:* 2009-08-27  16:03:30
> *收件人:* user
> *抄送:* weixuezhang; Abhijeet Pandey
> *主题:* Re: problem Running with MS-SQL
>  *Hi Zhang,
>
> Thanks for this.
>
> Can you guide me that if i need to change all "unique=false" in all the
> entitymodel.xml (there are about 26 of them)?
>
> Hi All,
>
>
> Does anyone have an idea that why it happens with MSSQL ?
>
> Thanks ,
>
> Abhijeet Pandey
> *
>
> On Sun, Aug 16, 2009 at 4:16 PM, Weixue Zhang <weixuezh...@hotmail.com>wrote:
>
>>
>> I am using ms sql server 2005 and this problem had bothered me for long
>> time.
>> At last I found it was caused by a few unique indices of some tables (You
>> can find them by searching with "unique="true"" in files entitymodel.xml).
>> After I changed them into "unique=false", demo data works fine. Can
>> anybody
>> explain why this problem doesn't exist with other database servers, and
>> why
>> we need to set unique=true at some indices while most others are
>> unique=false?
>>
>> Weixue Zhang
>> --
>> View this message in context:
>> http://www.nabble.com/problem-Running-with-MS-SQL-tp24895969p24992345.html
>>  Sent from the OFBiz - User mailing list archive at Nabble.com.
>>
>>
>
>
> --
> Abhijeet Pandey
>



-- 
Abhijeet Pandey

Reply via email to