problem Running with MS-SQL

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

Re: Database description

Jacques Le Roux
Administrator
Look for Model in wiki

Jacques

From: "manish" <[hidden email]>

> Hi;
>
> Can any one tell how I can find the description of the database.. I wan to know the role of each table.
>
> With Regards,
> Manish.K
> www.cevalsoft.com
>
>  Go Green
>  Print only when necessary.
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Database description

chris snow
In reply to this post by manish-25
I found the "Data Model Resource" book Volume 1 to be very useful:

http://docs.ofbiz.org/x/QQg


manish-25 wrote
Hi;

Can any one tell how I can find the description of the database.. I wan to know the role of each table.
 
With Regards,
Manish.K
www.cevalsoft.com          

 Go Green
  Print only when necessary.

Reply | Threaded
Open this post in threaded view
|

Re: problem Running with MS-SQL

Abhijeet Pandey
In reply to this post by Weixue Zhang
*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 <[hidden email]>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
Reply | Threaded
Open this post in threaded view
|

Re: problem Running with MS-SQL

Abhijeet Pandey
Hi,

Does anybody who have implemented ofbiz with MSSQL can guide me please?

Thanks,

Abhijeet Pandey

On Thu, Aug 27, 2009 at 1:33 PM, Abhijeet Pandey
<[hidden email]>wrote:

> *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 <[hidden email]>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 | Threaded
Open this post in threaded view
|

Re: Re: problem Running with MS-SQL

Weixue Zhang
In reply to this post by Weixue Zhang
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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: problem Running with MS-SQL

Scott Gray-2
Hi Weixue,

Could you point me to an example of where the demo data violates a  
unique constraint?

Thanks
Scott

HotWax Media
http://www.hotwaxmedia.com

On 31/08/2009, at 12:12 PM, weixuezhang 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  
> <[hidden email]> 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


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

Re: problem Running with MS-SQL

David E. Jones-2

This sounds like one of those MS-SQL quirks with unique indexes where  
it only allows one row with each possible value, including null. In  
other words, there can only be one record with a null value in that  
column. If I remember right this has come up before too...

There may be a way to change the ALTER statement that adds the index  
to tell it to not include null. It would be nice if that was the  
default since the whole notion is silly, but that's just my subjective  
opinion and obviously theirs is different.

-David


On Aug 30, 2009, at 8:00 PM, Scott Gray wrote:

> Hi Weixue,
>
> Could you point me to an example of where the demo data violates a  
> unique constraint?
>
> Thanks
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 31/08/2009, at 12:12 PM, weixuezhang 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 <[hidden email]
>> > 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
>

Reply | Threaded
Open this post in threaded view
|

Re: problem Running with MS-SQL

Vince Clark
I have run into this problem with SQL Server also. Dropping unique indexes takes care of it. However, I am also running into serious problems with deadlocks in SQL Server when loading large amounts of data programatically with simple methods. Everything I have read suggests indexes could be the culprit, but I haven't made the connection.

Vince Clark
www.globalera.com
[hidden email]
(303) 493-6723 office
(303) 523-4843 cell


----- Original Message -----
From: "David E Jones" <[hidden email]>
To: [hidden email]
Sent: Sunday, August 30, 2009 8:59:21 PM GMT -07:00 US/Canada Mountain
Subject: Re: problem Running with MS-SQL


This sounds like one of those MS-SQL quirks with unique indexes where  
it only allows one row with each possible value, including null. In  
other words, there can only be one record with a null value in that  
column. If I remember right this has come up before too...

There may be a way to change the ALTER statement that adds the index  
to tell it to not include null. It would be nice if that was the  
default since the whole notion is silly, but that's just my subjective  
opinion and obviously theirs is different.

-David


On Aug 30, 2009, at 8:00 PM, Scott Gray wrote:

> Hi Weixue,
>
> Could you point me to an example of where the demo data violates a  
> unique constraint?
>
> Thanks
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 31/08/2009, at 12:12 PM, weixuezhang 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 <[hidden email]
>> > 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
>

Reply | Threaded
Open this post in threaded view
|

Re: Re: problem Running with MS-SQL

Abhijeet Pandey
In reply to this post by Weixue Zhang
Hi Thanks,

it worked.

Thanks,

Abhijeet

On Mon, Aug 31, 2009 at 5:42 AM, weixuezhang <[hidden email]>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 <[hidden email]>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 | Threaded
Open this post in threaded view
|

Re: Re: problem Running with MS-SQL

Abhijeet Pandey
In reply to this post by Weixue Zhang
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 <[hidden email]>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 <[hidden email]>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 | Threaded
Open this post in threaded view
|

Re: Re: problem Running with MS-SQL

Mridul Pathak-2
Abhijeet,

Is it OFBiz demo data or demo data created by you?  If the demo data is
created by you then it looks like primary key sequence problem.  In OFBiz
sequence always start with 10000, so the recommended way of having demo/test
data is have sequences less then 10000, as we do have in OFBiz demo data, to
avoid conflicts.  You can fix your current problem by adjusting sequence for
ProductDimension entity in SequenceValueItem entity, but it would be
difficult if you have many such records in other entities as well.
--
Thanks & Regards
Mridul Pathak
Hotwax Media
http://www.hotwaxmedia.com
[hidden email]

2009/9/4 Abhijeet Pandey <[hidden email]>

> 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 <[hidden email]
> >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 <[hidden email]
> >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
>
12