[JBossCache] - JBossCache standalone with JBossTM
by jnorris10
JBossCache 1.4.1.SP3
JBossTM 4.2.3.SP5
I am having trouble getting transaction support working.
I have made the following transaction lookup class,
public class JBossTMTransactionManagerLookup implements TransactionManagerLookup {
|
| public TransactionManager getTransactionManager() throws Exception {
| return com.arjuna.ats.jta.TransactionManager.transactionManager();
| }
|
| }
and configured it in the treecache xml file:
| ...
| <attribute name="TransactionManagerLookupClass">....JBossTMTransactionManagerLookup</attribute>
| ...
|
Then, I create transactions like this:
| UserTransaction tx = com.arjuna.ats.jta.UserTransaction.userTransaction();
|
| tx.begin();
| // cache get/put operations:
| tx.commit();
|
This does not work. The TransactionManagerLookup class is never called. Furthermore, if it is called, I don't understand how JBossCache determines if there is a transaction open it can participate in. Does it lookup it's transaction manager and ask if there are any open transactions in the current Thread, or something like that?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080079#4080079
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080079
17Â years, 5Â months
[JBoss Seam] - Re: BigDecimal and JSF <f:convertNumber>
by atao
And use this to get a converter with l10n:
|
| import java.math.BigDecimal;
|
| import javax.faces.component.UIComponent;
| import javax.faces.context.FacesContext;
| import javax.faces.convert.NumberConverter;
|
| /**
| * Converts a Double or Long value provided by standard jsf number
| * converter to a BigDecimal value
| *
| * To get a locale-sensitive converter, java.text.NumberFormat is used
| * (through javax.faces.convert.NumberConverter).
| * The parsing done by java.math.BigDecimal is not affected by locale.
| * See javax.faces.convert.BigDecimalConverter
| *
| */
| public class BigDecimalConverter extends NumberConverter
| {
|
| /*
| * don't use BigDecimal ctor
| * see java.math.BigDecimal
| */
| public Object getAsObject(FacesContext context, UIComponent component, String string) {
| Object value = super.getAsObject(context, component, string);
| if (value instanceof Long) return BigDecimal.valueOf((Long) value);
| if (value instanceof Double) return BigDecimal.valueOf((Double) value);
| return value;
| }
| }
|
|
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080078#4080078
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080078
17Â years, 5Â months