java.lang.IllegalStateException - in case of no ConnectionFactory set
public void setSessionTransacted(boolean sessionTransacted)
Set the transaction mode that is used when creating a JMS Session.
Default is "false".
Note that within a JTA transaction, the parameters passed to
create(Queue/Topic)Session(boolean transacted, int acknowledgeMode)
method are not taken into account. Depending on the Java EE transaction context,
the container makes its own decisions on these values. Analogously, these
parameters are not taken into account within a locally managed transaction
either, since the accessor operates on an existing JMS Session in this case.
Setting this flag to "true" will use a short local JMS transaction
when running outside of a managed transaction, and a synchronized local
JMS transaction in case of a managed transaction (other than an XA
transaction) being present. This has the effect of a local JMS
transaction being managed alongside the main transaction (which might
be a native JDBC transaction), with the JMS transaction committing
right after the main transaction.
Vendor-specific extensions to the acknowledgment mode can be set here as well.
Note that inside an EJB, the parameters to the
create(Queue/Topic)Session(boolean transacted, int acknowledgeMode) method
are not taken into account. Depending on the transaction context in the EJB,
the container makes its own decisions on these values. See section 17.3.5
of the EJB spec.
sessionAcknowledgeMode - the acknowledgement mode constant