Upgrading to 12.04 - Help

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

Upgrading to 12.04 - Help

SkipDever
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

Reply | Threaded
Open this post in threaded view
|

Re: Upgrading to 12.04 - Help

Adrian Crum-3
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
>

Reply | Threaded
Open this post in threaded view
|

RE: Upgrading to 12.04 - Help

SkipDever
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:[hidden email]]
Sent: Monday, June 10, 2013 1:30 PM
To: [hidden email]
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
>


Reply | Threaded
Open this post in threaded view
|

Re: Upgrading to 12.04 - Help

Adrian Crum-3
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:[hidden email]]
> Sent: Monday, June 10, 2013 1:30 PM
> To: [hidden email]
> 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
>>
>

Reply | Threaded
Open this post in threaded view
|

RE: Upgrading to 12.04 - Help

SkipDever
Yes, all these import services have use-transaction = "false"

-----Original Message-----
From: Adrian Crum [mailto:[hidden email]]
Sent: Monday, June 10, 2013 2:18 PM
To: [hidden email]
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:[hidden email]]
> Sent: Monday, June 10, 2013 1:30 PM
> To: [hidden email]
> 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
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Upgrading to 12.04 - Help

Christian Geisert
In reply to this post by SkipDever
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

Reply | Threaded
Open this post in threaded view
|

RE: Upgrading to 12.04 - Help

SkipDever
In reply to this post by Adrian Crum-3
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:[hidden email]]
Sent: Monday, June 10, 2013 2:18 PM
To: [hidden email]
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:[hidden email]]
> Sent: Monday, June 10, 2013 1:30 PM
> To: [hidden email]
> 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
>>
>