[JBoss Cache: Core Edition] - Standalone cache, what TransactionManager to use?
by molsen-ee
I'm implementing a standalone cache (not using any other JBoss packages) and am looking for information on what TransactionManager to use.
Currently it falls back to "DummyTransactionManager" and that seems to be unfit for production use. The only other TM in the jboss-cache-core package is the BatchModeTransactionManager, it's code indicates it is for POJO caches.
I ask because I think my other issue (posted below, regarding memory usage) is linked to uncommitted transactions filling up memory. When I try to commit the transactions as such:
| GenericTransactionManagerLookup tml = new GenericTransactionManagerLookup();
| tml.getTransactionManager().commit();
|
I get the following exception:
| java.lang.IllegalStateException: thread not associated with transaction
| at org.jboss.cache.transaction.DummyBaseTransactionManager.commit(DummyBaseTransactionManager.java:74)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4161617#4161617
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4161617
17 years, 9 months
[JBoss Messaging] - Re: help on JmsXA
by mattlf
Clebert
Thank you for your response
In jboss-4.2.2.GA/server/messaging/deploy/jms-ds.xml , I set
<use-java-context>false</use-java-context>
and i was able to successfully use JmsXA
However
1. Enqueuing 100 messages with the implementation that i posted at the root of this thread-post takes 6 seconds
2. I also used JmsTemplate with JmsXA and got the same results
3. Then following your advice, i implemented the following and it took 7 seconds to enqueue messages (enqueuing loop below)
So i am concerned about the performance which are not in line with
http://www.jboss.org/file-access/default/members/jbossmessaging/freezone/...
Am i doing something wrong? Where can look into to investigate the problem? Thanks a lot for your advice
| public class JMSProvider {
|
| private InitialContext ic = null;
| private ConnectionFactory connectionFactory = null;
| private Queue queue = null;
| private Connection connection = null;
| private Session session = null;
| private MessageProducer messageProducer = null;
|
| public JMSProvider() throws JMSException, NamingException
| {
| ic = new InitialContext();
| connectionFactory = (ConnectionFactory)ic.lookup("/ConnectionFactory");
| queue = (Queue)ic.lookup("queue/D");
| connection = connectionFactory.createConnection();
| session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
| messageProducer = session.createProducer(queue);
| }
|
| public void simpleSend(final User user)
| {
|
| try
| {
|
| ObjectMessage msg = session.createObjectMessage(user);
| messageProducer.send(msg);
|
| }
| catch(JMSException e)
| {
|
| }
| }
|
| public void destroy() throws JMSException
| {
| messageProducer.close();
| session.close();
| connection.close();
| }
|
|
|
| }
|
| public class JmsTestServlet extends HttpServlet {
|
| private final Log logger = LogFactory.getLog(JmsTestServlet.class);
|
| /**
| *
| */
| private static final long serialVersionUID = -7696232061073152339L;
|
| @Override
| protected void doGet(HttpServletRequest req, HttpServletResponse resp)
| throws ServletException, IOException {
|
| WebApplicationContext context = WebApplicationContextUtils
| .getWebApplicationContext(this.getServletContext());
|
| final JMSProvider provider = (JMSProvider) context
| .getBean("jmsProvider");
|
| int perf = 100;
|
| Calendar startTime = Calendar.getInstance();
| for (int i = 0; i < perf; i++) {
|
| User user = new User();
| user.setId(new Long(i));
| user.setFirstName("first_" + i);
| user.setLastName("last_" + i);
|
| provider.simpleSend(user);
|
| }
| Calendar endTime = Calendar.getInstance();
| long millisec = endTime.getTimeInMillis() - startTime.getTimeInMillis();
| logger.info(perf+" messages sent in " + millisec + " milliseconds");
|
| }
|
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4161616#4161616
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4161616
17 years, 9 months