[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4391) Need to add transaction propagation types to @Transactional
by asookazian (JIRA)
Need to add transaction propagation types to @Transactional
-----------------------------------------------------------
Key: JBSEAM-4391
URL: https://jira.jboss.org/jira/browse/JBSEAM-4391
Project: Seam
Issue Type: Feature Request
Components: Core
Affects Versions: 2.2.0.GA
Environment: N/A
Reporter: asookazian
The current tx propagation types for use with @Transactional are the following:
REQUIRED, MANDATORY, SUPPORTS, NEVER;
Here is a comment from the TransactionalPropagationType enum class:
* Transaction propagation strategies for Seam JavaBean components. Note that unlike EJB3 components, there are no strategies for suspending transactions.
Please add REQUIRES_NEW and NOT_SUPPORTED. I am unable to solve my functional requirement of calling a webservice which inserts into remote db (which does not require a tx) and inserting into multiple local db tables (requires tx) using JavaBean components and Seam @Transactional. The requirement is that even if the webservice call fails, the local db inserts should continue and succeed (i.e. no atomicity, no rollback).
There is an action method in my JavaBean Seam component that is invoked from a commandButton in JSF page. Then there are two private methods that are invoked from that public method. One requires tx support, the other does not. With EJB3, I would simply use NOT_SUPPORTED for one and REQUIRES_NEW for the other. Now using JavaBeans and @Transactional, I cannot solve my problem in terms of tx support requirements. @Transactional only works on public methods.
I tried recalling the component's private method (now refactored to public with @Transactional) using Component.getInstance("foo"); but that did not work.
Spring has robust tx support like EJB 3. Seam needs to be ramped up in terms of tx support for JavaBean components.
References:
http://www.seamframework.org/Community/TransactionalPropagationTypes
http://www.seamframework.org/Community/TransactionalOnPrivateMethod
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 4 months
[JBoss JIRA] Created: (JBSEAM-4512) BPM task does not rollback
by Jason E (JIRA)
BPM task does not rollback
--------------------------
Key: JBSEAM-4512
URL: https://jira.jboss.org/jira/browse/JBSEAM-4512
Project: Seam
Issue Type: Bug
Components: BPM
Affects Versions: 2.2.0.GA
Environment: Testing this on Windows XP. Deploying to JBoss AS 4.2.2
Reporter: Jason E
I have made a simple change to the ShipAction.java class in the dvdstore example that ships with Seam. Here is the change
//@EndTask
public String ship() {
order.ship(track);
TaskInstance ti = ManagedJbpmContext.instance().getTaskInstance(taskInstance.getId());
taskInstance.end();
if(true) throw new RuntimeException("TESTING");
return "admin";
}
I commented out the end task annotation and I am ending the task via the TaskInstance API. When I throw the Runtime exception the changes to the ORDERS entity bean (i.e. updating the tracking number) rolls back. The problem is that the task instance change (i.e. ending the task) does not rollback. It appears that jBPM is flushing its changes in another db transaction. This seems like a bug since I would expect the ending of my task to also rollback. This seems like the desired behavior.
This was the only change I made to the dvdstore example that ships with Seam 2.2.0.GA so it should be easy to reproduce.
Thanks!
Jason
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 4 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2764) Factory method does not create objects properly
by Bogdan Minciu (JIRA)
Factory method does not create objects properly
-----------------------------------------------
Key: JBSEAM-2764
URL: http://jira.jboss.com/jira/browse/JBSEAM-2764
Project: JBoss Seam
Issue Type: Bug
Components: EJB3
Affects Versions: 2.0.1.GA
Reporter: Bogdan Minciu
Hello,
It seems that my @Factory method is recognizing the created objects only in its command block. I have this class:
@Stateful
@Name("xtw")
@Scope(ScopeType.SESSION)
@AutoCreate
public class XTextSessionWrapper implements LocalXTextSessionWrapper {
...
@In(required=false, create=true)
@Out
private XLanguage activeLanguage;
public String getText(String identifier) {
log.info("getText(1): identifier= #0, activeLanguage= #1", identifier, getActiveLanguage());
XTextEntry xte = xTextEntryDAO.findXTextEntry(identifier, getActiveLanguage());
log.info("getText(2): identifier= #0, activeLanguage= #1", identifier, getActiveLanguage());
xte.getXtext();
}
@Factory(value="activeLanguage", autoCreate=true)
public void initActiveLanguage() {
XLanguage xl = xLanguageDAO.findXLanguageByIdentifier("ro");
log.info("initActiveLanguage(1): activeLanguage initialized to #0", xl.getIdentifier());
setActiveLanguage(xl);
log.info("initActiveLanguage(1): activeLanguage initialized to #0", getActiveLanguage().getIdentifier());
}
public XLanguage getActiveLanguage() {
return activeLanguage;
}
public void setActiveLanguage(XLanguage activeLanguage) {
this.activeLanguage = activeLanguage;
}
...
}
And i am calling the getText() method. The method calling is as expected:
1. the injected activeLanguage is detecting that it has a null value,
2. the initActiveLanguage() factory method is called
3. then the getText() method is continuing its execution.
But, the problem is that when the application exists the @Factory method block, the created objects: activeLanguage is lost and reported again as null.
Here is the output:
12:43:48,203 INFO [XTextSessionWrapper] initActiveLanguage(1): activeLanguage initialized to ro
12:43:48,203 INFO [XTextSessionWrapper] initActiveLanguage(1): activeLanguage initialized to ro
12:43:48,703 INFO [XTextSessionWrapper] initActiveLanguage(1): activeLanguage initialized to ro
12:43:48,703 INFO [XTextSessionWrapper] initActiveLanguage(1): activeLanguage initialized to ro
12:43:48,703 INFO [XTextSessionWrapper] getText(1): identifier= com.brit.xcms.cms.Category.12.name, activeLanguage= null
12:43:49,234 INFO [XTextSessionWrapper] getText(2): identifier= com.brit.xcms.cms.Category.12.name, activeLanguage= null
Where did I went wrong? Why is the activeLanguage factoried value lost when i leave the initActiveLanguage() method?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 5 months
[JBoss JIRA] Created: (SEAMXML-22) support collection and array virtual fields
by Dan Allen (JIRA)
support collection and array virtual fields
-------------------------------------------
Key: SEAMXML-22
URL: https://jira.jboss.org/browse/SEAMXML-22
Project: Seam XML Configuration
Issue Type: Feature Request
Affects Versions: 3.0.0.Beta1
Reporter: Dan Allen
Fix For: 3.0.0.Beta2
Add support for defining virtual fields that are of type collection or array. This should work already in theory, but no matter what I tried, I got errors, so it may simply be broken. There is also one piece missing. There needs to be a way to specify the collection type parameter (item type). I'm envisioning something like this:
<List>
<Integer/> <-- defines item type
<app:DiceValues/>
<value>1</value>
<value>2</value>
<value>3</value>
<value>4</value>
<value>5</value>
<value>6</value>
</List>
defines the virtual field:
@DiceValues
List<Integer> anonymous;
In the same way, we should support virtual arrays:
<array>
<Integer/>
<app:DiceValues/>
<value>1</value>
<value>2</value>
<value>3</value>
<value>4</value>
<value>5</value>
<value>6</value>
</array>
producing:
@DiceValues
Integer[] anonymous;
The nested element for the type is a bit awkward, though (I suggested it because it's currently how array's are typed). It would make more sense to use an attribute here:
<List itemType="java.lang.Integer">
...
</List>
Also, a way to control the implementation type:
<List type="java.util.ArrayList" itemType="java.lang.Integer">
...
</List>
Once working, there definitely needs to be an example (or two) added to the documentation.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months