<div dir="ltr">It&#39;s a common behavior for tables without primary keys.<br>The database lock all table on insert/update/delete.<br><br>I looked in my postgresql keycloak database and found alot of tables without PK:<br>composite_role, databasechangelog, fed_providers, realm_application, realm_default_roles<br><br>Please add PK in all tables, in relationship tables manytomany add a composite PK (embedded id).<br></div><br><div class="gmail_quote">On Tue, May 5, 2015 at 2:31 PM Marek Posolda &lt;<a href="mailto:mposolda@redhat.com">mposolda@redhat.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Unfortunately the test is failing on all RDBMS, not just H2 :-(<br>
<br>
I did debugging with MySQL yesterday and saw that UserSessionEntity was<br>
successfully deleted in chained backchannel logout request, but<br>
transaction in original request failed due to foreign key<br>
(UserSessionNote couldn&#39;t be added to already deleted UserSession)<br>
<br>
As mentioned in private mail, I see this possible solutions:<br>
<br>
1) When parent broker receives logout request from child broker, the<br>
parent shouldn&#39;t send another backchannel logout request to the same<br>
child broker again.<br>
<br>
2) Add the flag to UserSession before it sends backchannel logout<br>
request to parent broker. When parent broker sends logout request back<br>
to the child, the child broker will see the flag on UserSession and it<br>
won&#39;t try to remove it.<br>
<br>
It looks that (2) is better as it will work with 3rd party parent<br>
brokers as well. Basically (1) requires handling the situation on parent<br>
broker, but with 3rd party parent brokers, we don&#39;t have control if they<br>
implement this.<br>
<br>
Marek<br>
<br>
On 5.5.2015 18:32, Bill Burke wrote:<br>
&gt; In tracking down a bug I found that in certain cases the database (H2?)<br>
&gt; that comes with Wildfly will perform table-level locks.  It definitely<br>
&gt; does a table lock in transactions that require inserts.  Not sure if it<br>
&gt; happens on regular row updates.<br>
&gt;<br>
&gt; Makes me feel like we have been really lucky altogether that we haven&#39;t<br>
&gt; run into problems so far.<br>
<br>
_______________________________________________<br>
keycloak-dev mailing list<br>
<a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
</blockquote></div>