You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Skip <sk...@thedevers.org> on 2013/06/10 22:20:05 UTC

Upgrading to 12.04 - Help

I am upgrading to 12.04 and trying to import what I exported from the old
system.  The ProductCatalog entity is being exported with parents coming
after the entries and fails.  So, I tried to run a service that I wrote to
import these catagories in the correct order.

This import service imports 2/3s of these values and then fails with:

scheduleServiceSync caused an error with the following message: Service
dispatcher threw and exception:service[importProductCategory] threw an
unexpected exception (Error getting next result (ERROR: portal "C_8516" does
not exist))

I have run this service (and dozens more) without ever seeing this.

There is no stack trace in the log.

This is on postgres 9.1 with the latest jdbc driver (same as my previous 9.0
based Ofbiz).

I am guessing that this is on a line like catagory = importCategory.next()
from a delegator.findListIteratorByCondition() because there is a line above
error with a warning "auto-closed the EntityListIterator because of
exception (... same as above, eg. (ERROR: portal "C_8516" does not exist)).

Anyone have a clue on this?

Skip


Re: Upgrading to 12.04 - Help

Posted by Christian Geisert <ch...@isu-gmbh.de>.
Am 10.06.2013 22:20, schrieb Skip:
> I am upgrading to 12.04 and trying to import what I exported from the old
> system.  The ProductCatalog entity is being exported with parents coming
> after the entries and fails.  So, I tried to run a service that I wrote to

What about using the -createfks parameter with commandline import, i.e.

java -jar ofbiz.jar -install -dir=/dir/xml -timeout=7200 -createfks=true

Christian


RE: Upgrading to 12.04 - Help

Posted by Skip <sk...@thedevers.org>.
Thanks Adrian and Christian for your responses.

Turns out that the problem was a transaction begin/end around the
findListIteratorByCondition.

In the past, you got an exception if you did not do this.

So, in case anyone else has this problem, if you have code like this:
TransactionUtil.begin();   // since the service is not inside a transaction,
this needs to be in its own transaction, or you'll get a harmless exception
EntityListIterator importCategory =
delegator.findListIteratorByCondition("DataImportProductCatagory",
conditions, null, null);
TransactionUtil.commit();

make it look like this:
EntityListIterator importCategory =
delegator.findListIteratorByCondition("DataImportProductCatagory",
conditions, null, null);

Or like this if you are sure the data will fit into memory:
TransactionUtil.begin();   // since the service is not inside a transaction,
this needs to be in its own transaction, or you'll get a harmless exception
EntityListIterator importCategory =
delegator.findListIteratorByCondition("DataImportProductCatagory",
conditions, null, null);
List values = importCategory.getCompleteList();
TransactionUtil.commit();

-----Original Message-----
From: Adrian Crum [mailto:adrian.crum@sandglass-software.com]
Sent: Monday, June 10, 2013 2:18 PM
To: user@ofbiz.apache.org
Subject: Re: Upgrading to 12.04 - Help


Are you sure the import service is not in a transaction?

-Adrian

On 6/10/2013 9:39 PM, Skip wrote:
> That does not seem right because there is a transaction around the
> findListIteratorByCondition and another around each .store()/commit()
> operation.
>
> Because you used to get an exception if you did not have a transaction
> around findListIteratorByCondition, all my code does this and for these
> import services where there may be millions of entries to make and I don't
> want it to fail if only a few are bad, I have a transaction around each
> commit and that cannot take too long.
>
> Skip
>
>
>
> -----Original Message-----
> From: Adrian Crum [mailto:adrian.crum@sandglass-software.com]
> Sent: Monday, June 10, 2013 1:30 PM
> To: user@ofbiz.apache.org
> Subject: Re: Upgrading to 12.04 - Help
>
>
> I believe it means Postgres has closed the connection to the database.
> Maybe the transaction took too long.
>
> -Adrian
>
> On 6/10/2013 9:20 PM, Skip wrote:
>> I am upgrading to 12.04 and trying to import what I exported from the old
>> system.  The ProductCatalog entity is being exported with parents coming
>> after the entries and fails.  So, I tried to run a service that I wrote
to
>> import these catagories in the correct order.
>>
>> This import service imports 2/3s of these values and then fails with:
>>
>> scheduleServiceSync caused an error with the following message: Service
>> dispatcher threw and exception:service[importProductCategory] threw an
>> unexpected exception (Error getting next result (ERROR: portal "C_8516"
> does
>> not exist))
>>
>> I have run this service (and dozens more) without ever seeing this.
>>
>> There is no stack trace in the log.
>>
>> This is on postgres 9.1 with the latest jdbc driver (same as my previous
> 9.0
>> based Ofbiz).
>>
>> I am guessing that this is on a line like catagory =
importCategory.next()
>> from a delegator.findListIteratorByCondition() because there is a line
> above
>> error with a warning "auto-closed the EntityListIterator because of
>> exception (... same as above, eg. (ERROR: portal "C_8516" does not
> exist)).
>> Anyone have a clue on this?
>>
>> Skip
>>
>



RE: Upgrading to 12.04 - Help

Posted by Skip <sk...@thedevers.org>.
Yes, all these import services have use-transaction = "false"

-----Original Message-----
From: Adrian Crum [mailto:adrian.crum@sandglass-software.com]
Sent: Monday, June 10, 2013 2:18 PM
To: user@ofbiz.apache.org
Subject: Re: Upgrading to 12.04 - Help


Are you sure the import service is not in a transaction?

-Adrian

On 6/10/2013 9:39 PM, Skip wrote:
> That does not seem right because there is a transaction around the
> findListIteratorByCondition and another around each .store()/commit()
> operation.
>
> Because you used to get an exception if you did not have a transaction
> around findListIteratorByCondition, all my code does this and for these
> import services where there may be millions of entries to make and I don't
> want it to fail if only a few are bad, I have a transaction around each
> commit and that cannot take too long.
>
> Skip
>
>
>
> -----Original Message-----
> From: Adrian Crum [mailto:adrian.crum@sandglass-software.com]
> Sent: Monday, June 10, 2013 1:30 PM
> To: user@ofbiz.apache.org
> Subject: Re: Upgrading to 12.04 - Help
>
>
> I believe it means Postgres has closed the connection to the database.
> Maybe the transaction took too long.
>
> -Adrian
>
> On 6/10/2013 9:20 PM, Skip wrote:
>> I am upgrading to 12.04 and trying to import what I exported from the old
>> system.  The ProductCatalog entity is being exported with parents coming
>> after the entries and fails.  So, I tried to run a service that I wrote
to
>> import these catagories in the correct order.
>>
>> This import service imports 2/3s of these values and then fails with:
>>
>> scheduleServiceSync caused an error with the following message: Service
>> dispatcher threw and exception:service[importProductCategory] threw an
>> unexpected exception (Error getting next result (ERROR: portal "C_8516"
> does
>> not exist))
>>
>> I have run this service (and dozens more) without ever seeing this.
>>
>> There is no stack trace in the log.
>>
>> This is on postgres 9.1 with the latest jdbc driver (same as my previous
> 9.0
>> based Ofbiz).
>>
>> I am guessing that this is on a line like catagory =
importCategory.next()
>> from a delegator.findListIteratorByCondition() because there is a line
> above
>> error with a warning "auto-closed the EntityListIterator because of
>> exception (... same as above, eg. (ERROR: portal "C_8516" does not
> exist)).
>> Anyone have a clue on this?
>>
>> Skip
>>
>



Re: Upgrading to 12.04 - Help

Posted by Adrian Crum <ad...@sandglass-software.com>.
Are you sure the import service is not in a transaction?

-Adrian

On 6/10/2013 9:39 PM, Skip wrote:
> That does not seem right because there is a transaction around the
> findListIteratorByCondition and another around each .store()/commit()
> operation.
>
> Because you used to get an exception if you did not have a transaction
> around findListIteratorByCondition, all my code does this and for these
> import services where there may be millions of entries to make and I don't
> want it to fail if only a few are bad, I have a transaction around each
> commit and that cannot take too long.
>
> Skip
>
>
>
> -----Original Message-----
> From: Adrian Crum [mailto:adrian.crum@sandglass-software.com]
> Sent: Monday, June 10, 2013 1:30 PM
> To: user@ofbiz.apache.org
> Subject: Re: Upgrading to 12.04 - Help
>
>
> I believe it means Postgres has closed the connection to the database.
> Maybe the transaction took too long.
>
> -Adrian
>
> On 6/10/2013 9:20 PM, Skip wrote:
>> I am upgrading to 12.04 and trying to import what I exported from the old
>> system.  The ProductCatalog entity is being exported with parents coming
>> after the entries and fails.  So, I tried to run a service that I wrote to
>> import these catagories in the correct order.
>>
>> This import service imports 2/3s of these values and then fails with:
>>
>> scheduleServiceSync caused an error with the following message: Service
>> dispatcher threw and exception:service[importProductCategory] threw an
>> unexpected exception (Error getting next result (ERROR: portal "C_8516"
> does
>> not exist))
>>
>> I have run this service (and dozens more) without ever seeing this.
>>
>> There is no stack trace in the log.
>>
>> This is on postgres 9.1 with the latest jdbc driver (same as my previous
> 9.0
>> based Ofbiz).
>>
>> I am guessing that this is on a line like catagory = importCategory.next()
>> from a delegator.findListIteratorByCondition() because there is a line
> above
>> error with a warning "auto-closed the EntityListIterator because of
>> exception (... same as above, eg. (ERROR: portal "C_8516" does not
> exist)).
>> Anyone have a clue on this?
>>
>> Skip
>>
>


RE: Upgrading to 12.04 - Help

Posted by Skip <sk...@thedevers.org>.
That does not seem right because there is a transaction around the
findListIteratorByCondition and another around each .store()/commit()
operation.

Because you used to get an exception if you did not have a transaction
around findListIteratorByCondition, all my code does this and for these
import services where there may be millions of entries to make and I don't
want it to fail if only a few are bad, I have a transaction around each
commit and that cannot take too long.

Skip



-----Original Message-----
From: Adrian Crum [mailto:adrian.crum@sandglass-software.com]
Sent: Monday, June 10, 2013 1:30 PM
To: user@ofbiz.apache.org
Subject: Re: Upgrading to 12.04 - Help


I believe it means Postgres has closed the connection to the database.
Maybe the transaction took too long.

-Adrian

On 6/10/2013 9:20 PM, Skip wrote:
> I am upgrading to 12.04 and trying to import what I exported from the old
> system.  The ProductCatalog entity is being exported with parents coming
> after the entries and fails.  So, I tried to run a service that I wrote to
> import these catagories in the correct order.
>
> This import service imports 2/3s of these values and then fails with:
>
> scheduleServiceSync caused an error with the following message: Service
> dispatcher threw and exception:service[importProductCategory] threw an
> unexpected exception (Error getting next result (ERROR: portal "C_8516"
does
> not exist))
>
> I have run this service (and dozens more) without ever seeing this.
>
> There is no stack trace in the log.
>
> This is on postgres 9.1 with the latest jdbc driver (same as my previous
9.0
> based Ofbiz).
>
> I am guessing that this is on a line like catagory = importCategory.next()
> from a delegator.findListIteratorByCondition() because there is a line
above
> error with a warning "auto-closed the EntityListIterator because of
> exception (... same as above, eg. (ERROR: portal "C_8516" does not
exist)).
>
> Anyone have a clue on this?
>
> Skip
>



Re: Upgrading to 12.04 - Help

Posted by Adrian Crum <ad...@sandglass-software.com>.
I believe it means Postgres has closed the connection to the database. 
Maybe the transaction took too long.

-Adrian

On 6/10/2013 9:20 PM, Skip wrote:
> I am upgrading to 12.04 and trying to import what I exported from the old
> system.  The ProductCatalog entity is being exported with parents coming
> after the entries and fails.  So, I tried to run a service that I wrote to
> import these catagories in the correct order.
>
> This import service imports 2/3s of these values and then fails with:
>
> scheduleServiceSync caused an error with the following message: Service
> dispatcher threw and exception:service[importProductCategory] threw an
> unexpected exception (Error getting next result (ERROR: portal "C_8516" does
> not exist))
>
> I have run this service (and dozens more) without ever seeing this.
>
> There is no stack trace in the log.
>
> This is on postgres 9.1 with the latest jdbc driver (same as my previous 9.0
> based Ofbiz).
>
> I am guessing that this is on a line like catagory = importCategory.next()
> from a delegator.findListIteratorByCondition() because there is a line above
> error with a warning "auto-closed the EntityListIterator because of
> exception (... same as above, eg. (ERROR: portal "C_8516" does not exist)).
>
> Anyone have a clue on this?
>
> Skip
>