Re: Token creation is not thread safe

2018-04-13 Thread Francesco Chicchiriccò
On 13/04/2018 09:48, Isuranga Perera wrote: Hi Francesco, Yes, that will fix the problem. Glad we agree :-) I'll set SYNCOPE-1301; please close the PR #70. Regards. On Fri, Apr 13, 2018 at 1:00 PM, Francesco Chicchiriccò Hi, after our discussion on PR #70 [1] yesterday, I took the chance t

Re: Token creation is not thread safe

2018-04-13 Thread Isuranga Perera
Hi Francesco, Yes, that will fix the problem. Best Regards Isuranga Perera On Fri, Apr 13, 2018 at 1:00 PM, Francesco Chicchiriccò wrote: > Hi, > after our discussion on PR #70 [1] yesterday, I took the chance to review > the AccessToken creation logic and committed a change [2] which should f

Re: Token creation is not thread safe

2018-04-13 Thread Francesco Chicchiriccò
Hi, after our discussion on PR #70 [1] yesterday, I took the chance to review the AccessToken creation logic and committed a change [2] which should fix your warnings from SYNCOPE-1301. Please, take a look at let me know if we can consider SYNCOPE-1301 as resolved. Regards. [1] https://git

Re: Token creation is not thread safe

2018-04-09 Thread Isuranga Perera
Sure will work on that. I'll give priority to this feature and will continue to work on the eclipse project upon the completion of this one. Best Regards Isuranga Perera On Mon, Apr 9, 2018 at 4:27 PM, Francesco Chicchiriccò wrote: > On 09/04/2018 11:24, Isuranga Perera wrote: > >> Sure will wo

Re: Token creation is not thread safe

2018-04-09 Thread Francesco Chicchiriccò
On 09/04/2018 11:24, Isuranga Perera wrote: Sure will work on that. Shall I create a JIRA? Yes, please. Do set both 2.0.9 and 2.1.0 as fix-for-versions since I will apply your PR both to branches master and 2_0_X. Sorry for the delay will submit the ICLA asap Ok, thanks. Regards. On Mo

Re: Token creation is not thread safe

2018-04-09 Thread Isuranga Perera
Sure will work on that. Shall I create a JIRA? Sorry for the delay will submit the ICLA asap Best Regards Isuranga Perera On Mon, Apr 9, 2018 at 2:45 PM, Francesco Chicchiriccò wrote: > On 09/04/2018 11:10, Isuranga Perera wrote: > >> Since such condition can happen only if the same user tries

Re: Token creation is not thread safe

2018-04-09 Thread Francesco Chicchiriccò
On 09/04/2018 11:10, Isuranga Perera wrote: Since such condition can happen only if the same user tries to login from 2 mediums at the same, this is rarely happen. However that slight chance may prevent that particular user from login to the system until all or all-1 access tokens are expired. Us

Re: Token creation is not thread safe

2018-04-09 Thread Isuranga Perera
Since such condition can happen only if the same user tries to login from 2 mediums at the same, this is rarely happen. However that slight chance may prevent that particular user from login to the system until all or all-1 access tokens are expired. Using the UNIQUE constraint will definitely will

Re: Token creation is not thread safe

2018-04-09 Thread Francesco Chicchiriccò
On 09/04/2018 10:14, Isuranga Perera wrote: The Read Committed isolation level ensures that data can only be read by a transaction if it is in the committed state. It doesn't completely isolate this transaction(create) hence some other transaction can still use this method which results in the be

Re: Token creation is not thread safe

2018-04-09 Thread Isuranga Perera
The Read Committed isolation level ensures that data can only be read by a transaction if it is in the committed state. It doesn't completely isolate this transaction(create) hence some other transaction can still use this method which results in the behavior I explained previously. Ideally If we'

Re: Token creation is not thread safe

2018-04-09 Thread Francesco Chicchiriccò
On 09/04/2018 09:30, Isuranga Perera wrote: Hi Francesco, Yes there is @Transactional annotation. But it haven't set the isolation property as well as the propagation property. Based on the default values set this thread safe problem will still occur. Please correct me if I'm wrong. The transa

Re: Token creation is not thread safe

2018-04-09 Thread Isuranga Perera
Hi Francesco, Yes there is @Transactional annotation. But it haven't set the isolation property as well as the propagation property. Based on the default values set this thread safe problem will still occur. Please correct me if I'm wrong. Best Regards On Mon, Apr 9, 2018 at 12:20 PM, Francesco

Re: Token creation is not thread safe

2018-04-08 Thread Francesco Chicchiriccò
On 09/04/2018 08:46, Isuranga Perera wrote: Hi Francesco, I will take a scenario. Suppose a scenario where thread A & thread B try to login user admin. 1. thread A checks if a token exist for the user admin (suppose currently there is no token associated with the admin) 2. Then thread A

Re: Token creation is not thread safe

2018-04-08 Thread Isuranga Perera
Hi Francesco, I will take a scenario. Suppose a scenario where thread A & thread B try to login user admin. 1. thread A checks if a token exist for the user admin (suppose currently there is no token associated with the admin) 2. Then thread A execute following logic[1] to create and sav

Re: Token creation is not thread safe

2018-04-08 Thread Francesco Chicchiriccò
On 09/04/2018 07:07, Isuranga Perera wrote: Hi All, Token create method in AccessTokenDataBinderImpl[1] is not thread safe. Could you please explain why you're affirming this? This could result in several problems including * Exist 2 different access token for a particular user at a given

Token creation is not thread safe

2018-04-08 Thread Isuranga Perera
Hi All, Token create method in AccessTokenDataBinderImpl[1] is not thread safe. This could result in several problems including - Exist 2 different access token for a particular user at a given time which may result in an exception thrown by method call[2] since it expects a single token