<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
A jberet user reported
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a class="issue-link" data-issue-key="JBERET-29"
href="https://issues.jboss.org/browse/JBERET-29" id="key-val"
rel="12531044">JBERET-29</a> (Foreign key constraint
step_execution_jobexecutionid_fkey fails when using Postgresql on
WildFly, and we are trying to fix it by jberet 1.0.0.Final. The
problem happens when user app starts a job within a transaction
(e.g., CMT EJB), jberet inserts JobExecution into database (thread 1
& transaction 1), and then spawn a jberet-batch thread to run
the job (thead 2 & transaction 2). Sometimes T2 tries to access
db before T1 is committed, hence the error reported by the user.<br>
<br>
What's the common approach for solving this kind of problem? I
suppose other WildFly components may also have this issue and
probably already solved. Using transaction synchronization is a
cleaner solution than polling db, but I'm not sure about its full
implication. Ideally, I don't want to use system level JTA API like
TransactionManager or Synchronization in jberet proper, but probably
we can implement it in WildFly jberet integration.<br>
<br>
Thanks,<br>
Cheng<br>
</body>
</html>