SFSRuntimeException: Join request discarded. User is already in a join transaction

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
Lapo
Site Admin
Posts: 21723
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SFSRuntimeException: Join request discarded. User is already in a join transaction

Postby Lapo » 10 Apr 2019, 09:06

I am not sure what you mean by this.
As I already explained you can't multi-join a User in more than one Room concurrently.

If this is a use case in your game, join them serially: either by waiting for the necessary events, or by using a lock so that multiple threads will take turns.

I have provided clear examples on how to use both approaches.

To reiterate: each join transaction (for the same User) has to be completed before another one can be started.
Other than that joining Rooms is perfectly thread safe and concurrent.

I have seen something on the internet, which was not thread safe at all.

I have no idea what you're referring to... :?:

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
Jochanan
Posts: 79
Joined: 11 May 2018, 09:12

Re: SFSRuntimeException: Join request discarded. User is already in a join transaction

Postby Jochanan » 10 Apr 2019, 09:45

Lapo wrote:To reiterate: each join transaction (for the same User) has to be completed before another one can be started.
Other than that joining Rooms is perfectly thread safe and concurrent.


I am asking you to PROVE your statement by showing the code snippet of joinRoom implementation.
User avatar
Lapo
Site Admin
Posts: 21723
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SFSRuntimeException: Join request discarded. User is already in a join transaction

Postby Lapo » 10 Apr 2019, 11:20

You have submitted a request about an exception while joining Rooms and I've given you ample explanation and detailed examples and clarification on how to implement your solution.

If the solution I've provided doesn't work, or there are related issues let us know, posting all the details.

Thanks you
Lapo

--

gotoAndPlay()

...addicted to flash games
Jochanan
Posts: 79
Joined: 11 May 2018, 09:12

Re: SFSRuntimeException: Join request discarded. User is already in a join transaction

Postby Jochanan » 10 Apr 2019, 12:21

...
if (user.getSomeBoolean())
{
throw new Exception()
}

user.SetSomeBoolean(true);
...

is not thread safe solution. Is it solution you use in joinRoom api or not?
User avatar
Lapo
Site Admin
Posts: 21723
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SFSRuntimeException: Join request discarded. User is already in a join transaction

Postby Lapo » 10 Apr 2019, 12:48

Is it a difficult task to just read what I wrote three times in this same topic?
Join requests are not supposed to be concurrent for the same User. If you need to do that, use synchronization.

Thank you
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 21723
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SFSRuntimeException: Join request discarded. User is already in a join transaction

Postby Lapo » 10 Apr 2019, 12:50

Lapo wrote:Is it a difficult task to just read what I wrote three times in this same topic?
Join requests are not supposed to be concurrent for the same User. If you need to do that, use synchronization.

We'll make sure to clarify this in the docs, for corner cases like yours.

Thank you
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 24 guests