Hi,
This question is pertinent to the scopes of transactions that IBatis
supports. Are the below settings valid to be specified in
SqlMapconfig.xml:
Local transactions : transactionManager=JDBC
Global Active: transactionManager=JTA
Global Passive: transactionManager=External
Is my assumption
Once again I seem to have found a solution shortly after asking the question...
On 08/04/2008, Alistair Young [EMAIL PROTECTED] wrote:
[ ... snip ... ]
// start a transaction
// [iBATIS starts a new JTA transaction...?]
sqlMapClient.startTransaction();
// ... do
Thanks for the tips, Jeff. It appears, however, that although the
iBATIS startTransaction will not start another transaction if a JTA
transaction exists, it will still thrown an exception. (I'd assumed -
incorrectly - that all of the transaction handling would be handed off
to JTA).
Anyway, I
UserTransaction is a configuration setting required for JTA. See here:
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/cjta_glotran.html
You are correct that JTA is only *needed* if there are two or more
resources. However, even
. Take a look at the class
com.ibatis.sqlmap.engine.transaction.jta.JtaTransaction
to see what's going on.
If a JTA transaction already exists...
1. The iBATIS startTransaction will not start another transaction
2. The iBATIS commit does nothing
3. The iBATIS rollback marks the transaction
on.
If a JTA transaction already exists...
1. The iBATIS startTransaction will not start another transaction
2. The iBATIS commit does nothing
3. The iBATIS rollback marks the transaction for rollback, but does not
rollback itself
When there are externally managed transactions
Hello all,
Is there any example or pointer for an app using multiple data sources, in
which
transaction management is done using ibatis JTA Tx Manager itself
(No spring involved) . The Tx spans ops across multiple databases.
I did search around the forum, but they were not very clear
Hi there
I have configured iBatis to use JTA like this:
transactionManager type=JTA
property name=UserTransaction value=UserTransaction/
dataSource type=JNDI
property name=DataSource value=java:/MyDS/
/dataSource
Try setting
transactionManager type=JTA *commitRequired=true*
...
/transactionManager
Without this setting, iBATIS will not commit transactions (either automatic
or explicit) that only have selects in them. We see a similar issue on
WebSphere.
Jeff Butler
On 3/30/07, Mehul [EMAIL PROTECTED
When it comes to Transaction Management, there are few frameworks (if any)
better than Spring.
Your choices are:
* Spring (with iBATIS EXTERNAL TX type).
* Your App Server, with a container managed data source and connection
(with iBATIS EXTERNAL TX type).
* iBATIS JTA TX type. Very few
Is there anyone out there using iBATIS with JNDI within WebSphere without
EJBs that is willing to share their settings?
Thanks
Mike
On Mon, Aug 25, 2008 at 5:17 PM, Jeff Butler [EMAIL PROTECTED] wrote:
UserTransaction is a configuration setting required for JTA. See here:
http
is a configuration setting required for JTA. See here:
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/cjta_glotran.html
You are correct that JTA is only *needed* if there are two or more
resources. However, even with one resource I believe
Hello again,
After figuring out my previous problem, I've got my iBATIS/JTA test
application working up to a point (start transaction, update followed
by end or commit).
Now, according to the book iBATIS in Action, when configured to use
a JTA transactionManager, iBATIS will look for the global
Hi folks,
I just want to make sure my basic understanding of JTA and container
managed transactions is right. I''ve defined a Datasource under
JBoss in an XML file. I believe since I specificed
local-tx-datasource, transactions are managed by the JBoss Transaction
Manager.
Therefore to use
Hi all
We are using iBatis SQLMaps 2.1.15 on a WebSphere App
Server 5.1.
In the transaction manager section of the SQLMaps XML
(configuration) file we need to qualify entirely the JNDI name for the
JTA User transaction in order to iBatis do a successful look in the JNDI tree
Has anybody successfully used iBATIS and Geronimo, using the
JTA transaction manager? My code does not fail, and yet nothing is committed
to the database. Ive asked the Geronimo guys, but they dont seem
to know what is going on.
Thanks,
Michael
Hi
I was trying to work with JTA IBatis and WebLogic combination for my
persistence layer.
My configuration as below...
transactionManager type=JTA
property name=UserTransaction
value=javax.transaction.UserTransaction/
dataSource type=JNDI
property
Hello all,
I've been using iBATIS for a while quite successfully with a
transactionManager type of JDBC - however, I now want to use JTA and
am not having so much luck.
I have a block of code like this:
// start a transaction
dao.startTransaction();
// get and update
it is
kind of broken right now. Works great for a couple hundred users, but once
we passed a thousand things started to slow down and connection count went
up. Hopefully going directly to JTA will remove some of the overhead.
Thanks so much for your response.
Mike
On Wed, Aug 27, 2008 at 2:14 PM
On 08/04/2008, Alistair Young [EMAIL PROTECTED] wrote:
Hello all,
I've been using iBATIS for a while quite successfully with a
transactionManager type of JDBC - however, I now want to use JTA and
am not having so much luck.
[ ... snip ...]
Can anybody help? I think I must be missing
/oss/display/IBATIS/Environment+Specific+Information)
in a recent post pointed me to a different config:
transactionManager type=JTA commitRequired=true
property name=UserTransaction
value=java:comp/env/UserTransaction/
dataSource type=JNDI
property name=DataSource
try transactionManager commitRequired=true On 1/25/06, Michael Laccetti [EMAIL PROTECTED]
wrote:
Has anybody successfully used iBATIS and Geronimo, using the
JTA transaction manager? My code does not fail, and yet nothing is committed
to the database. I've asked the Geronimo guys
Hi Clinton,
Just a bit confused.
Want to clarify this thing.
Do you mean to say that when a EXTERNAL transaction manager is used, the
startTransaction will start a new transaction and will not participate in the
parent transaction. And if the JTA transaction manager is used
I'll reply to my own message for posterity:
The EXTERNAL transaction manager is not JTA-aware, it just does nothing
(assuming a JTA-aware DataSource will handle commits/rollbacks) if you
use the SqlMapClient transaction demarcation. However, the
functionality hinted at by the documentation
, when working with JTA transaction managers I have extended the
iBatis provided classes, e.g. JtaTransactionConfig, and added my own
functionality to them. Along the same lines, I am thinking that I should be
able to extend the com.carreker.ibatis.common.jdbc.SimpleDataSource class and
override
(HIBERNATE,
HibernateDaoTransactionManager.class.getName());
typeAliases.put(JDBC, JdbcDaoTransactionManager.class.getName());
typeAliases.put(JTA, JtaDaoTransactionManager.class.getName());
typeAliases.put(OJB, OjbBrokerTransactionManager.class.getName());
typeAliases.put(SQLMAP
iBATIS and Geronimo, using the JTA transaction
manager? My code does not fail, and yet nothing is committed to the
database. I've asked the Geronimo guys, but they don't seem to know what
is going on.
Thanks,
Michael
Hi Jeff,
My application does not create additional Thread.
About JTA, you are saying if we are setting iBatis to use JTA, we also
have to change our JDBC code?
We are using Select + Scrollable ResultSet in order to move the cursoer to
a specific position in the ResultSet ... this couldn't
.
So in WebSphere, you should look up the datasource from JNDI, look up the transaction from JNDI, demarcate the transactions correctly according to the JTA spec, and make sure that all connections are closed after they are used.
This link in the WebSphere documentation is a good starting point
for the environment in which you are
running.
So in WebSphere, you should look up the datasource from JNDI, look up the
transaction from JNDI, demarcate the transactions correctly according to
the
JTA spec, and make sure that all connections are closed after they are
used.
This link
types:
1) Local
2) Global (JTA)
3) External (???)
Basically, what we're trying to do is create the ability to weave method
calls at runtime. Suppose we have two methods that update database 1.
This operates with a local transaction manager.
Now, at runtime, we can weave a third method (which
=JDBC.Password value=encrypted value / using my own
encryption algorithm.In the past, when working with JTA
transaction managers I have extended the iBatis provided classes, e.g.
JtaTransactionConfig, and added my own functionality to them. Along the
same lines, I am thinking that I should be able
(EXTERNAL,ExternalDaoTransactionManager.class.getName()); typeAliases.put(HIBERNATE,HibernateDaoTransactionManager.class.getName
()); typeAliases.put(JDBC, JdbcDaoTransactionManager.class.getName()); typeAliases.put(JTA, JtaDaoTransactionManager.class.getName()); typeAliases.put(OJB
value=DataSource name=java:comp/env/jdbc/fooDb/
/dataSource /transactionManager
[/code]
I am not sure if the type is EXTERNAL, JDBC, or JTA.
Also, if I utilize the Pet Store as an example, I have a certain process that loads an excel spreadsheet into three separate tables in three separate
PROTECTED]
wrote:
Has
anybody successfully used iBATIS and Geronimo, using the JTA transaction
manager? My code does not fail, and yet nothing is committed to the database.
I've asked the Geronimo guys, but they don't seem to know what is going on.
Thanks,
Michael
In your sqlmapconfig.xml file ;
If your application is in the context of an AppServer; then the config
below should help:
transactionManager type=JTA commitRequired=false
property name=UserTransaction value=java:comp/UserTransaction
/
dataSource type=JNDI
property name
on the web
site.
What are the versions of the libraries used by iBatis (i.e. oscache, jta,
commons-dbcp, commons-logging)? Do you have any dependency report a lá Maven
2 available?
Example output from the AspectJ weaver:
can't determine superclass of missing type
to use
the EXTERNAL (sometimes JTA depending on your container) transaction manager
and a JNDI data source.
Clinton
On Thu, Jun 26, 2008 at 8:20 PM, Jim Worke [EMAIL PROTECTED] wrote:
Hi,
What is the proper way of using iBatis with EJB? Currently, I have the
following in my stateless session
When using EXTERNAL transactions, the startTransaction() method does
nothing. So JTA's transaction is not being called either - EXTERNAL means
that iBATIS is completely trusting some external source to manage
transactions (like an EJB container).
If you want to control JTA from withing iBATIS
+1 to Jeff, those settings have already been removed from the trunk.
Use EXTERNAL if you're using EJB or Spring (or any other transaction capable
container), or JTA if you're using iBATIS alone with XA connections.
Otherwise, using JDBC should work fine too.
Clinton
Clinton
From
Please give it a try with the transaction configuration I sent previously.
EXTERNAL will not work unless there are EJBs- the transactions are never being committed and that's why WebSphere is holding on to them.
JDBC should work, but I'm certain that JTA will work because that's what we use
are never
being committed and that's why WebSphere is holding on to them.
JDBC should work, but I'm certain that JTA will work because that's what
we
use in our non-EJB applications.
Jeff Butler
On 6/22/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hi,
We are not using EJB but we have
place is that I managed to find a bug in the JConnect JDBC driver that is
not scheduled to be fixed any time soon. Setting this property causes an
exception to be raised when I run in Jta. (Although I am told it is not Jta
related) My work-around for now it to use an older version of the driver
in multiple thread.
Which thread do some calcs and persist them.
I need that all processment work in only one transaction.
How can I do that with ibatis sql mapper ?
I don't have JTA, and sqlmapclient is threadlocal.
Regards,
--
--
Paulo
JdbcDaoTransaction(dataSource); for a JDBC and similarly for JTA,
SQLMap etc.
Each of these hold a connection object and hence should not colide with each
other.
Rgds
Prashanth Sukumaran.
--- Louis Letourneau [EMAIL PROTECTED] wrote:
Hello,
I'm trying to understand the problems/issues
If you set the TransactionManager type to EXTERNAL, then the
start/commit/end will have no effect. Or if you set it to JTA,
then it will attempt to participate in the global transaction if
possible.
Cheers,
ClintonOn 10/18/05, Gary Barlow [EMAIL PROTECTED] wrote:
Thanks Clinton,Yep that has
on the transaction
which is managed by the container?
Thanks
Gary
If you set the TransactionManager type to EXTERNAL, then the
start/commit/end will have no effect. Or if you set it to JTA, then it will
attempt to participate in the global transaction if possible.
Cheers,
Clinton
On 10/18/05
/commit/end will have no effect. Or if you set it to JTA, then it willattempt to participate in the global transaction if possible.Cheers,ClintonOn 10/18/05, Gary Barlow
[EMAIL PROTECTED] wrote: Thanks Clinton, Yep that has the desired effect, however, I'm running this in the EJB layer
?Are there any good examples I can use?
I am aware that the SqlMapClient, when created, relates to one of thefollowing transactional types:1)Local2)Global (JTA)3)External (???)Basically, what we're trying to do is create the ability to weave method
calls at runtime.Suppose we have two methods that update
that delegates to JTA (for a transactional JNDI DataSource)
--
!--
Necessary here due to the need for distributed transactions across two
databases --
bean
id=transactionManager
class=org.springframework.transaction.jta.JtaTransactionManager
property
name=userTransactionName
value
This works for me (in WAS 5.1 and WAS 6.0 - I assume it works in WAS 5.0 too):
dao.xml:
transactionManager type=SQLMAP
property name=SqlMapConfigResource
value=path_to_your_sqlmapconfig_file/
/transactionManager
SqlMapConfig.xml:
transactionManager type=JTA commitRequired=true
property name
are not using EJBs, then this is a more appropriate transaction configuration:
transactionManager type=JTA commitRequired=trueproperty name=UserTransaction value=java:comp/UserTransaction/dataSource type=JNDI
property name=DataSource value=${DBSOURCE}//dataSource/transactionManager
Jeff Butler
The JavaDoc for the Spring SqlMapClientFactoryBean says:
The default ExternalTransactionConfig is appropriate if there is
external transaction management that the SqlMapClient should participate
in: be it Spring transaction management, EJB CMT or plain JTA. This
should be the typical scenario
Hi All,
We are using Spring_iBATIS ,for our application and JBoss as
Application server.For this we need to configure JTA for connection
pooling,
In this situation is there any way to handle rollback() externally by
getting Connection or Transaction objects.
Right now we
probably best to use EXTERNAL or JTA transacation manager with
WebSphere (depending on whether you are using CMT or not) - see the
information in this WIKI page for examples:
http://opensource.atlassian.com/confluence/oss/display/IBATIS/Environment+Specific+Information
Jeff Butler
On Jan 30, 2008 9
a transaction and roll
it back for even a select?
Would JTA change this?
Thanks,
Tom
-Original Message-
From: Jeff Butler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 04, 2008 3:53 PM
To: user-java@ibatis.apache.org
Subject: Re: queryForList/Map/Object... rollbacks
What
and JTA transaction manager.
Yahoo! Deportes Beta
¡No te pierdas lo último sobre el torneo clausura 2008! Entérate aquí
http://deportes.yahoo.com
not normally commit the
transaction. But then the updates would be rolled back.
2. In a WebSphere environment when you are using connection pooling and
you use the JNDI
dataSource and the JDBC or JTA transaction manager. WebSphere requires
all transactions on
pooled connections to be committed
would
call the procedure with the queryForList() operation – so iBATIS would not
normally commit the
transaction. But then the updates would be rolled back.
2. In a WebSphere environment when you are using connection pooling and you
use the JNDI
dataSource and the JDBC or JTA transaction manager
would not normally commit the
transaction. But then the updates would be rolled back.
2. In a WebSphere environment when you are using connection
pooling and you use the JNDI
dataSource and the JDBC or JTA transaction manager. WebSphere
requires all transactions on
pooled
transaction.
How can I do that with ibatis sql mapper ?
I don't have JTA, and sqlmapclient is threadlocal.
Regards,
--
--
Paulo Jorge Zagalo das Neves
Linux User # 61096
--
MASTEK
with single transaction
Hi all,
I have a stand alone application, that process data in multiple thread.
Which thread do some calcs and persist them.
I need that all processment work in only one transaction.
How can I do that with ibatis sql mapper ?
I don't have JTA
a transaction and roll
it back for even a select?
Would JTA change this?
Thanks,
Tom
-Original Message-
From: Jeff Butler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 04, 2008 3:53 PM
To: user-java@ibatis.apache.org
Subject: Re: queryForList/Map/Object
and the JDBC or JTA transaction manager. WebSphere
requires all transactions on
pooled connections to be committed or the connection will not be
returned to the pool.
Note that the commitRequired attribute has no effect when using the EXTERNAL
transaction manager.
*
So it does not explain why your
the servers .
but i find after some days, the same issue comes back again .
I IBATIS ,Spring configuration i am using JTA Transaction with Transaction
Scope as Prototype .
In DAO i am not using any implicit Transaction in Java Code like
startBatch() and executeBatch() methods.
wanted to know
More News
I tried changing to a stand-alone transaction manager (not using JTA)
and it works fine
transactionManager type=JDBC
dataSource type=SIMPLE
property name=JDBC.Driver
value=com.ibm.db2.jcc.DB2Driver /
property name
I tried changing to a stand-alone transaction manager (not using JTA)and it works fine
transactionManager type=JDBC dataSource type=SIMPLE property name=JDBC.Drivervalue=com.ibm.db2.jcc.DB2Driver
/ property name=JDBC.ConnectionURLvalue=jdbc:db2://ukclawv01:50003/crd01 / property name
Butler
On 11/6/06, Paul
Carr [EMAIL PROTECTED]
wrote:
More News
I tried changing to a stand-alone transaction manager (not using JTA)
and it works fine
transactionManager type=JDBC
dataSource type=SIMPLE
property name=JDBC.Driver
value=com.ibm.db2.jcc.DB2Driver /
property
configuration is not
appropriate on WebSphere - unless you've configured some proprietary
WebSphere extensions to deal with container managed transactions with
servlets. If you are not using EJBs, then this is a more appropriate
transaction configuration:
transactionManager type=JTA
some proprietary
WebSphere extensions to deal with container managed transactions
with
servlets. If you are not using EJBs, then this is a more
appropriate
transaction configuration:
transactionManager type=JTA commitRequired=true
property name=UserTransaction value=java:comp
, then this is a more appropriate
transaction configuration:
transactionManager type=JTA commitRequired=true
property name=UserTransaction value=java:comp/UserTransaction/
dataSource type=JNDI
property name=DataSource value=${DBSOURCE}/
/dataSource
/transactionManager
Jeff Butler
transaction manager (your app server), more than on your database. For example, CMT on WebSphere should specify EXTERNAL transaction manager and SetAutoCommitAllowed=false.
BMT on WebSphere should specify JTA transaction manager, commitRequired=true, ignore the other settings.
Maybe we should
on your database. For example, CMT on WebSphere should specify EXTERNAL transaction manager and SetAutoCommitAllowed=false.
BMT on WebSphere should specify JTA transaction manager, commitRequired=true, ignore the other settings.
Maybe we should start a WIKI page with known working configurations
for even a select?
Would JTA change this?
Thanks,
Tom
-Original Message-
From: Jeff Butler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 04, 2008 3:53 PM
To: user-java@ibatis.apache.org
Subject: Re: queryForList/Map/Object... rollbacks
What transaction
. In a WebSphere environment when you are using connection pooling
and you use the JNDI
dataSource and the JDBC or JTA transaction manager. WebSphere
requires all transactions on
pooled connections to be committed or the connection will not be
returned to the pool.
Note
Hi Nathan,
I was running fine on WAS 5.0 with JDK 1.3.1, so I doubt it's
a JDK issue. When I started trying to move to WAS 6.0 I had some naming
difficulties ... my sqlmapconfig had java:comp in the JNDI names and
it didn't like itso I went from :-
transactionManager type=JTA
and
it didn't like itso I went from :-
transactionManager type=JTA commitRequired=true
property name=java:comp/UserTransaction
value=UserTransaction/
dataSource type=JNDI
property name=DataSource
value=java:comp/jdbc/db2Connection/
/dataSource
/transactionManager
posting to the list itself is not going to give you a boost in help. In
fact, it will probably make people ignore you.
As to your problem, you currently have your JNDI DataSource setup as a JDBC
source. Is this true or are you using a container managed DataSource? If
you are using something like a JTA
the commit and rollback calls to the connection,
as if you had called connection.commit()/.rollback() yourself.
The JTA transaction manager is quite a bit different and takes an active
role in a managed or distributed transaction, and will actually call commit
and rollback on the configured
-core/src/com/ibatis/sqlmap/engine/transaction/jdbc/JdbcTransaction.java
You'll see that it forwards the commit and rollback calls to the connection,
as if you had called connection.commit()/.rollback() yourself.
The JTA transaction manager is quite a bit different and takes an active
role
it back for even a select?
Would JTA change this?
Thanks,
Tom
-Original Message-
From: Jeff Butler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 04, 2008 3:53 PM
To: user-java@ibatis.apache.org
Subject: Re: queryForList/Map/Object... rollbacks
.
This is just a web application. I will take a look at the Wiki.
So is this default behavior of iBatis to create a transaction and roll
it back for even a select?
Would JTA change this?
Thanks,
Tom
-Original Message-
From: Jeff Butler [mailto:[EMAIL
behavior of iBatis to create a transaction and roll
it back for even a select?
Would JTA change this?
Thanks,
Tom
-Original Message-
From: Jeff Butler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 04, 2008 3:53 PM
To: user-java@ibatis.apache.org
Subject: Re: queryForList
managed DataSource? If
you are using something like a JTA provider through WAS, you will need
something like this:
transactionManager type=JTA
property name=UserTransaction value=java:/comp/UserTransaction/
dataSource type=JNDI
property name=DataSource value=java:comp/env
currently have your JNDI DataSource
setup as a
JDBC
source. Is this true or are you using a container managed
DataSource? If
you are using something like a JTA provider through WAS,
you will need
something like this:
transactionManager type=JTA
property name=UserTransaction
value=java
DataSource
setup as a
JDBC
source. Is this true or are you using a container managed
DataSource? If
you are using something like a JTA provider through WAS,
you will need
something like this:
transactionManager type=JTA
property name=UserTransaction
value=java:/comp/UserTransaction
something like a JTA provider through WAS,
you will need
something like this:
transactionManager type=JTA
property name=UserTransaction
value=java:/comp/UserTransaction/
dataSource type=JNDI
property name=DataSource
value=java:comp/env/jdbc/jpetstore/
/dataSource
something like a JTA provider through WAS,
you will need
something like this:
transactionManager type=JTA
property name=UserTransaction
value=java:/comp/UserTransaction/
dataSource type=JNDI
property name=DataSource
value=java:comp/env/jdbc/jpetstore/
/dataSource
name=DataSource value=MyOraclePool/
/dataSource/transactionManager Anything incorrect here? Thanks.
Bing On 6/16/05, Larry Meadors [EMAIL PROTECTED] wrote: What transaction manager are you using?
I think you may need ot set it to EXTERNAL or JTA. Larry
to work with WAS.
a. Set transactionManager commitRequired=true
b. If WAS is complaining about calls to setAutoCommit (false), then you might want to use EXTERNAL transaction management (i.e. not iBATIS JTA). This will allow your app server to declaratively control the transaction completely
the lock level?
which isolation level do you use?
i think this works for two JTA resources without XA (means Tx code
off)
because there the transaction manager need no two phase commit.
Dave Rodenbaugh wrotes:
Yes, I saw the release, just after I had completed
implementation with 2.2.0
are transitioning to JNDI datasource.
This is just a web application. I will take a look at the Wiki.
So is this default behavior of iBatis to create a transaction and roll
it back for even a select?
Would JTA change this?
Thanks,
Tom
-Original
ALIASES
vars.typeHandlerFactory.putTypeAlias(JDBC, JdbcTransactionConfig.class.getName());
vars.typeHandlerFactory.putTypeAlias(JTA, JtaTransactionConfig.class.getName());
vars.typeHandlerFactory.putTypeAlias(EXTERNAL, ExternalTransactionConfig.class.getName());
// DATA SOURCE
93 matches
Mail list logo