Hi,

I have no ideas if this is what is causing the problems you are
experiencing, however...
If I was designing the db for this, and if I understand you correctly, I
would have

tableZ for EbeanZ, with pk pkz

and 

tableY for EbeanY, with pk pky, and foreign key pkz from tableZ.

Now, in transaction 1 you insert a new record in tableZ, with a brand new
pk value.

Before committing, you start transaction 2 and try to add some records to
tableY, with the new pkz value you just got.  This value in tableZ is not
visible to transaction2, transaction 1 hasn't committed yet. So you would
get a fk violation.

Why does (6) need to be RequiresNew?

All this being said, it might be helpful to know which driver you are using
and the configuration files.

Autocommit is always already set to false.

David Jencks

 
On 2001.06.09 19:24:03 -0400 Aakash Chopra wrote:
> Hi all,
> 
> After hours of going through the JBoss-user Archives,
> I'm still unclear as to exactly what is going on with
> regard to JBoss's interaction with Oracle, Transactions,
> and autocommit.
> 
> Here is my particular problem:
> 
> 1. methodA1() in a Session Bean (SBeanA) is responsible
> for creating a particular type of CMP Entity Bean
> (EBeanZ).
> 
> 2. EBeanZ and all member methods are Container Transaction Managed
> set to: <trans-attribute>Required</trans-attribute>.
> 
> 3. SBeanA and all member methods are Container Transaction Managed
> set to: <trans-attribute>Required</trans-attribute>.
> 
> 4. methodA1() in SBeanA calls methodA2() in the same bean (SBeanA).
> 
> 5. methodA2() is responsible for creating another type of CMP
> Entity Bean (EBeanY).
> 
> 6. EBeanY and all member methods are Container Transaction Managed
> set to: <trans-attribute>RequiresNew</trans-attribute>.
> 
> 6.1. There is a 1 to many relationship between EBeanZ and EBeanY
> respectively.
> 
> 7. Everything works until I get to #5. That is, the following
> message is generated in the log files upon attempting to
> persist/create EBeanY instances (note the first line of output
> is caused by a system.out in the ejbCreate method of EBeanY):
> 
> [EBeanY] ejbCreate: Attempting to create: SCULE for owner: 100160
> [SBeanA] Transaction XidImpl [FormatId=257, GlobalId=buzzwin2//7,
> BranchQual=] timed out. status=STATUS_ACTIVE
> [SBeanA] Transaction XidImpl [FormatId=257, GlobalId=buzzwin2//8,
> BranchQual=] timed out. status=STATUS_ACTIVE
> 
> That's it. No more info, although I still have to set db logging when I
> find
> the correct property/flag.
> 
> Does anyone have any ideas about what is going on, and how I have to fix
> it.
> 
> If this has to do with autocommit, do I need to modify the jboss code to
> setAutoCommit(false)?
> 
> Thanks in advance for any suggestions / help.
> 
> Buzz
> 
> 
> 
> 
> 
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
> 


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to