[JBoss Seam] - Re: TransactionalSeamPhaseListener + Spring @Transactional
by youngm
anonymous wrote : can anyone explain me the effect, when I combine Seam TransactionalSeamPhaseListener with Spring @Transctional annotation in my service layer?
Well, first of all you need to make sure that they're configured to use the same JTA TransactionManager. With Seam 2.0.0 CR1 you will be able to configure Seam to use a Spring PlatformTransactionManager.
So, assuming you have Spring and Seam set up to use the same JTA TM then the TransactionalSeamPhaseListener will manage transaction begin and commit semantics for a faces request. If you call a method annotated with spring's @Transactional then by default Spring will join that transaction since the default spring propagation rule is "REQUIRED". You could use the spring TM to gain more fine grained control over you transaction with with Spring's transaction suspension support and nested support.
If the service method is called outside of a Faces Request (e.g. @Asynchronous call) then @Transactional would start a transaction since TransactionalSeamPhaseListener would not be available.
So in the end if in a faces request using @Transactional will have no effect unless you're using Spring's transaction suspension or nested transactions. If not in a faces request then @Transactional can be used to start and commit transactions when interacting with your service layer.
Does that answer your question?
Mike
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074080#4074080
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074080
18Â years, 11Â months
[Persistence, JBoss/CMP, Hibernate, Database] - Configuring JBoss to use Informix
by mackTheKnife73
This post might be better placed in the newbie forum but here goes anyway...
I've been trying to configure JBoss to use informix, I've followed the steps in
this http://www.redhat.com/docs/manuals/jboss/jboss-eap-4.2/doc/Server_Configu...
Substituting informix
And I've edited the sql in hsqldb-jdbc2-service.xml and jboss-service.xml so that the create table sql works for informix .... but now when I startup Jboss, I'm getting sql exceptions telling me that "jms_subscriptions" is not in the DB. Yet I have no exceptions before it in the trace to indicate there was a problem creating the table ?
Anyone out there with any ideas ?
15:40:50,145 DEBUG [ServiceController] starting service jboss.mq.destination:service=Topic,name=testTopic
15:40:50,145 DEBUG [testTopic] Starting jboss.mq.destination:service=Topic,name=testTopic
15:40:50,145 DEBUG [NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
15:40:50,145 DEBUG [NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
15:40:50,145 DEBUG [NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
15:40:50,145 DEBUG [testTopic] Starting failed jboss.mq.destination:service=Topic,name=testTopic
org.jboss.mq.SpyJMSException: Error getting durable subscriptions for topic TOPIC.testTopic; - nested throwable: (java.sql.SQLException: The specified table (jms_subscriptions) is not in the database.)
at org.jboss.mq.sm.jdbc.JDBCStateManager.getDurableSubscriptionIdsForTopic(JDBCStateManager.java:303)
at org.jboss.mq.server.JMSDestinationManager.addDestination(JMSDestinationManager.java:702)
at org.jboss.mq.server.jmx.Topic.startService(Topic.java:76)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
I do see this earlier in the trace ... but it seems the create is never called.
15:40:48,099 DEBUG [ServiceCreator] Created bean: jboss.mq:service=StateManager
15:40:48,099 DEBUG [ServiceController] recording that jboss.mq:service=StateManager depends on jboss.jca:service=DataSourceBinding,name=DefaultDS
15:40:48,099 DEBUG [ServiceConfigurator] considering ConnectionManager with object name jboss.jca:service=DataSourceBinding,name=DefaultDS
15:40:48,099 DEBUG [ServiceConfigurator] SqlProperties set to CREATE_TABLES_ON_STARTUP = TRUE
CREATE_USER_TABLE = CREATE TABLE JMS_USERS (USERID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, \
CLIENTID VARCHAR(128) NULL, PRIMARY KEY(USERID))
CREATE_ROLE_TABLE = CREATE TABLE JMS_ROLES (ROLEID VARCHAR(32) NOT NULL, USERID VARCHAR(32) NOT NULL, \
PRIMARY KEY(USERID, ROLEID))
CREATE_SUBSCRIPTION_TABLE = CREATE TABLE JMS_SUBSCRIPTIONS (CLIENTID VARCHAR(128) NOT NULL, \
SUBNAME VARCHAR(128) NOT NULL, TOPIC VARCHAR(255) NOT NULL, \
SELECTOR VARCHAR(255) NULL, PRIMARY KEY(CLIENTID, SUBNAME))
GET_SUBSCRIPTION = SELECT TOPIC, SELECTOR FROM JMS_SUBSCRIPTIONS WHERE CLIENTID=? AND SUBNAME=?
LOCK_SUBSCRIPTION = SELECT TOPIC, SELECTOR FROM JMS_SUBSCRIPTIONS WHERE CLIENTID=? AND SUBNAME=?
GET_SUBSCRIPTIONS_FOR_TOPIC = SELECT CLIENTID, SUBNAME, SELECTOR FROM JMS_SUBSCRIPTIONS WHERE TOPIC=?
INSERT_SUBSCRIPTION = INSERT INTO JMS_SUBSCRIPTIONS (CLIENTID, SUBNAME, TOPIC, SELECTOR) VALUES(?,?,?,?)
UPDATE_SUBSCRIPTION = UPDATE JMS_SUBSCRIPTIONS SET TOPIC=?, SELECTOR=? WHERE CLIENTID=? AND SUBNAME=?
REMOVE_SUBSCRIPTION = DELETE FROM JMS_SUBSCRIPTIONS WHERE CLIENTID=? AND SUBNAME=?
GET_USER_BY_CLIENTID = SELECT USERID, PASSWD, CLIENTID FROM JMS_USERS WHERE CLIENTID=?
GET_USER = SELECT PASSWD, CLIENTID FROM JMS_USERS WHERE USERID=?
POPULATE.TABLES.01 = INSERT INTO JMS_USERS (USERID, PASSWD) VALUES ('guest', 'guest')
POPULATE.TABLES.02 = INSERT INTO JMS_USERS (USERID, PASSWD) VALUES ('j2ee', 'j2ee')
POPULATE.TABLES.03 = INSERT INTO JMS_USERS (USERID, PASSWD, CLIENTID) VALUES ('john', 'needle', 'DurableSubscriberExample')
POPULATE.TABLES.04 = INSERT INTO JMS_USERS (USERID, PASSWD) VALUES ('nobody', 'nobody')
POPULATE.TABLES.05 = INSERT INTO JMS_USERS (USERID, PASSWD) VALUES ('dynsub', 'dynsub')
POPULATE.TABLES.06 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('guest','guest')
POPULATE.TABLES.07 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('j2ee','guest')
POPULATE.TABLES.08 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('john','guest')
POPULATE.TABLES.09 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('subscriber','john')
POPULATE.TABLES.10 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('publisher','john')
POPULATE.TABLES.11 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('publisher','dynsub')
POPULATE.TABLES.12 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('durpublisher','john')
POPULATE.TABLES.13 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('durpublisher','dynsub')
POPULATE.TABLES.14 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('noacc','nobody') in jboss.mq:service=StateManager
15:40:48,099 DEBUG [ServiceController] Creating service jboss.mq:service=StateManager
15:40:48,099 DEBUG [ServiceController] waiting in create of jboss.mq:service=StateManager waiting on jboss.jca:service=DataSourceBinding,name=DefaultDS
15:40:48,099 DEBUG [MainDeployer] Done with create step of deploying hsqldb-jdbc-state-service.xml
15:40:48,099 DEBUG [MainDeployer] Begin deployment start file:/C:/Dev/jboss-4.2.0.GA/server/default/deploy/jms/hsqldb-jdbc-state-service.xml
15:40:48,099 DEBUG [SARDeployer] Deploying SAR, start step: url file:/C:/Dev/jboss-4.2.0.GA/server/default/deploy/jms/hsqldb-jdbc-state-service.xml
Am I missing a service ? ... sorry fairly new to this stuff so any help would be really appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074078#4074078
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074078
18Â years, 11Â months