Re: [controller-dev] Getting exception when using Transaction Chain

2017-03-06 Thread Tom Pantelis
No - as I mentioned the caller must coordinate access.

On Tue, Mar 7, 2017 at 2:06 AM, Satish Dutt <sd...@advaoptical.com> wrote:

> Yes Tom, we are accessing a chain concurrently. Is there any waiting
> mechanism provided by the transaction chain such that the transaction chain
> waits for allocating a new one till the previous write transaction is
> submitted ?
>
>
>
> Regards
>
> -Satish
>
>
>
> *From:* Tom Pantelis [mailto:tompante...@gmail.com]
> *Sent:* Tuesday, March 07, 2017 2:38 AM
> *To:* Satish Dutt <sd...@advaoptical.com>
> *Cc:* Robert Varga <n...@hq.sk>; controller-us...@lists.opendaylight.org;
> controller-dev@lists.opendaylight.org
>
> *Subject:* Re: [controller-dev] Getting exception when using Transaction
> Chain
>
>
>
> It seems you're trying to access a chain concurrently? If so, this is not
> supported. You must coordinate access to the chain such that the previous
> write transaction is submitted before you allocate a new one.
>
>
>
> Tom
>
>
>
> On Mon, Mar 6, 2017 at 7:05 AM, Satish Dutt <sd...@advaoptical.com> wrote:
>
> Thanks Robert for the clarification. So to solve the issue, can I handle
> this IllegalStateException and retry the read or write operations for a
> finite number of times, which makes the best effort of previous
> write-capable transactions to get completed. Or is there a more elegant way
> of solving this issue ?
>
> Regards
> -Satish
>
>
> -Original Message-
> From: Robert Varga [mailto:n...@hq.sk]
> Sent: Monday, March 06, 2017 5:23 PM
> To: Satish Dutt <sd...@advaoptical.com>; controller-users@lists.
> opendaylight.org; controller-dev@lists.opendaylight.org
> Subject: Re: [controller-dev] Getting exception when using Transaction
> Chain
>
> On 03/06/2017 12:39 PM, Satish Dutt wrote:
> > When multiple requests are sent concurrently, IllegalStateException is
> > thrown. Is there any way to solve this issue, apart from synchronizing
> > the method which does the above operations ?
>
> This is actually part of the API contract:
>
> https://github.com/opendaylight/controller/blob/
> a81d98f692b80c45bce3fe6a87e731abfb012a9f/opendaylight/md-
> sal/sal-common-api/src/main/java/org/opendaylight/
> controller/md/sal/common/api/data/TransactionChain.java#L59
>
> The reason is very simple: if there is a write-capable transaction open
> and it has seen some modifications, does the second transaction observe
> those modifications as applied or as unapplied?
>
> Bye,
> Robert
>
> ___
> controller-dev mailing list
> controller-dev@lists.opendaylight.org
> https://lists.opendaylight.org/mailman/listinfo/controller-dev
>
>
>
___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev


Re: [controller-dev] Getting exception when using Transaction Chain

2017-03-06 Thread Satish Dutt
Yes Tom, we are accessing a chain concurrently. Is there any waiting mechanism 
provided by the transaction chain such that the transaction chain waits for 
allocating a new one till the previous write transaction is submitted ?

Regards
-Satish

From: Tom Pantelis [mailto:tompante...@gmail.com]
Sent: Tuesday, March 07, 2017 2:38 AM
To: Satish Dutt <sd...@advaoptical.com>
Cc: Robert Varga <n...@hq.sk>; controller-us...@lists.opendaylight.org; 
controller-dev@lists.opendaylight.org
Subject: Re: [controller-dev] Getting exception when using Transaction Chain

It seems you're trying to access a chain concurrently? If so, this is not 
supported. You must coordinate access to the chain such that the previous write 
transaction is submitted before you allocate a new one.

Tom

On Mon, Mar 6, 2017 at 7:05 AM, Satish Dutt 
<sd...@advaoptical.com<mailto:sd...@advaoptical.com>> wrote:
Thanks Robert for the clarification. So to solve the issue, can I handle this 
IllegalStateException and retry the read or write operations for a finite 
number of times, which makes the best effort of previous write-capable 
transactions to get completed. Or is there a more elegant way of solving this 
issue ?

Regards
-Satish

-Original Message-
From: Robert Varga [mailto:n...@hq.sk<mailto:n...@hq.sk>]
Sent: Monday, March 06, 2017 5:23 PM
To: Satish Dutt <sd...@advaoptical.com<mailto:sd...@advaoptical.com>>; 
controller-us...@lists.opendaylight.org<mailto:controller-us...@lists.opendaylight.org>;
 
controller-dev@lists.opendaylight.org<mailto:controller-dev@lists.opendaylight.org>
Subject: Re: [controller-dev] Getting exception when using Transaction Chain

On 03/06/2017 12:39 PM, Satish Dutt wrote:
> When multiple requests are sent concurrently, IllegalStateException is
> thrown. Is there any way to solve this issue, apart from synchronizing
> the method which does the above operations ?

This is actually part of the API contract:

https://github.com/opendaylight/controller/blob/a81d98f692b80c45bce3fe6a87e731abfb012a9f/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionChain.java#L59

The reason is very simple: if there is a write-capable transaction open and it 
has seen some modifications, does the second transaction observe those 
modifications as applied or as unapplied?

Bye,
Robert
___
controller-dev mailing list
controller-dev@lists.opendaylight.org<mailto:controller-dev@lists.opendaylight.org>
https://lists.opendaylight.org/mailman/listinfo/controller-dev

___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev


Re: [controller-dev] Getting exception when using Transaction Chain

2017-03-06 Thread Tom Pantelis
It seems you're trying to access a chain concurrently? If so, this is not
supported. You must coordinate access to the chain such that the previous
write transaction is submitted before you allocate a new one.

Tom

On Mon, Mar 6, 2017 at 7:05 AM, Satish Dutt <sd...@advaoptical.com> wrote:

> Thanks Robert for the clarification. So to solve the issue, can I handle
> this IllegalStateException and retry the read or write operations for a
> finite number of times, which makes the best effort of previous
> write-capable transactions to get completed. Or is there a more elegant way
> of solving this issue ?
>
> Regards
> -Satish
>
> -Original Message-
> From: Robert Varga [mailto:n...@hq.sk]
> Sent: Monday, March 06, 2017 5:23 PM
> To: Satish Dutt <sd...@advaoptical.com>; controller-users@lists.
> opendaylight.org; controller-dev@lists.opendaylight.org
> Subject: Re: [controller-dev] Getting exception when using Transaction
> Chain
>
> On 03/06/2017 12:39 PM, Satish Dutt wrote:
> > When multiple requests are sent concurrently, IllegalStateException is
> > thrown. Is there any way to solve this issue, apart from synchronizing
> > the method which does the above operations ?
>
> This is actually part of the API contract:
>
> https://github.com/opendaylight/controller/blob/
> a81d98f692b80c45bce3fe6a87e731abfb012a9f/opendaylight/md-
> sal/sal-common-api/src/main/java/org/opendaylight/
> controller/md/sal/common/api/data/TransactionChain.java#L59
>
> The reason is very simple: if there is a write-capable transaction open
> and it has seen some modifications, does the second transaction observe
> those modifications as applied or as unapplied?
>
> Bye,
> Robert
>
> ___
> controller-dev mailing list
> controller-dev@lists.opendaylight.org
> https://lists.opendaylight.org/mailman/listinfo/controller-dev
>
___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev


Re: [controller-dev] Getting exception when using Transaction Chain

2017-03-06 Thread Robert Varga
On 03/06/2017 01:05 PM, Satish Dutt wrote:
> Thanks Robert for the clarification. So to solve the issue, can I handle this 
> IllegalStateException and retry the read or write operations for a finite 
> number of times, which makes the best effort of previous write-capable 
> transactions to get completed. Or is there a more elegant way of solving this 
> issue ?

There is now way you can get around that exception. As for a solution,
you have seen
https://github.com/opendaylight/controller/blob/a81d98f692b80c45bce3fe6a87e731abfb012a9f/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionChain.java#L92,
right?

Regards,
Robert



signature.asc
Description: OpenPGP digital signature
___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev


Re: [controller-dev] Getting exception when using Transaction Chain

2017-03-06 Thread Satish Dutt
Thanks Robert for the clarification. So to solve the issue, can I handle this 
IllegalStateException and retry the read or write operations for a finite 
number of times, which makes the best effort of previous write-capable 
transactions to get completed. Or is there a more elegant way of solving this 
issue ?

Regards
-Satish

-Original Message-
From: Robert Varga [mailto:n...@hq.sk] 
Sent: Monday, March 06, 2017 5:23 PM
To: Satish Dutt <sd...@advaoptical.com>; 
controller-us...@lists.opendaylight.org; controller-dev@lists.opendaylight.org
Subject: Re: [controller-dev] Getting exception when using Transaction Chain

On 03/06/2017 12:39 PM, Satish Dutt wrote:
> When multiple requests are sent concurrently, IllegalStateException is 
> thrown. Is there any way to solve this issue, apart from synchronizing 
> the method which does the above operations ?

This is actually part of the API contract:

https://github.com/opendaylight/controller/blob/a81d98f692b80c45bce3fe6a87e731abfb012a9f/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionChain.java#L59

The reason is very simple: if there is a write-capable transaction open and it 
has seen some modifications, does the second transaction observe those 
modifications as applied or as unapplied?

Bye,
Robert

___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev


Re: [controller-dev] Getting exception when using Transaction Chain

2017-03-06 Thread Robert Varga
On 03/06/2017 12:39 PM, Satish Dutt wrote:
> When multiple requests are sent concurrently, IllegalStateException is
> thrown. Is there any way to solve this issue, apart from synchronizing
> the method which does the above operations ?

This is actually part of the API contract:

https://github.com/opendaylight/controller/blob/a81d98f692b80c45bce3fe6a87e731abfb012a9f/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionChain.java#L59

The reason is very simple: if there is a write-capable transaction open
and it has seen some modifications, does the second transaction observe
those modifications as applied or as unapplied?

Bye,
Robert



signature.asc
Description: OpenPGP digital signature
___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev