Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] TableGenerator and concurrency



On 5/31/2013 4:33 PM, Laird Nelson wrote:
On Fri, May 31, 2013 at 1:15 PM, Laird Nelson <ljnelson@xxxxxxxxx
<mailto:ljnelson@xxxxxxxxx>> wrote:

    On Fri, May 31, 2013 at 1:05 PM, Andrei Ilitchev
    <andrei.ilitchev@xxxxxxxxxx <mailto:andrei.ilitchev@xxxxxxxxxx>> wrote:

        By default TableGenerator uses the same connection that's used
        by insert.


    OK, so the same connection, fine, but...the same transaction too?
      It doesn't do a new BEGIN TRANSACTION before it does its UPDATE
    and SELECT work?


I partially withdraw the question :-) as it turns out that Informix does
not support nested transactions, so there's no way to, well, nest
transactions.  :-)

I don't remember offhand if JDBC dictates that there is one transaction
per connection, but that would certainly answer the question.
it does

More troublingly, it means that this reference
(http://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg04973.html)
is simply wrong.  That is, the table generator sequencing activities do
/not/ happen in an "autonomous transaction" after all.

So suppose, then, I decide to use this:

<property name="eclipselink.jdbc.__sequence-connection-pool" value="true"/>

You then said: "For that to work in JTA case specify nonJtaDatasource
(it will be used by sequencing connections)".  I didn't parse that.

Do you mean that in my persistence.xml I should define a
<non-jta-data-source> element as well as my (existing) <jta-data-source>
element and that somehow EclipseLink will use this?
Yes.
How does it know?
If both Jta and nonJta data sources specified then jtaDataSource is used inside JTA transaction, nonJtaDataSource - outside JTA transaction. Both Jta and NonJta data source connected to the same place (db, schema, user), just different transactioning.
  How does the rest of the application know to use my <jta-data-source>
and not the <non-jta-data-source>?  Sorry to be dense here.

Best,
Laird
--
http://about.me/lairdnelson


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



Back to the top