You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "Ross, Niall" <Ni...@agriculture.gov.ie> on 2006/12/12 13:26:06 UTC

Problem committing records using IBATIS in embedded jar file

Hi,

I am having the following problem and I was wondering had anyone encountered this type of thing before 
or could someone possibly lend a hand with a solution.

Ok here's the setup:

Project A uses ibatis to control all transaction management functionality needed.
Project B also uses ibatis but also includes Project A in the form of a jar.

We are currently developing in Project B and wish to prevent duplication of code so we 
want to re-use the DB related calls from Project A within Project B through the Project A jar.
With me so far???

When we execute code from Project A that alters a table in some way we use the DAOManager to 
start, end and commit the transactions. This is working in Project A.

The problem occurs when trying to execute this same code through the jar file from within Project B 
as when we the execute the code the transaction does not get committed at all. It will however be committed
when I physically shutdown my local appserver.

It seems to me that there is some sort of IBATIS config conflict problem when trying to execute transaction management 
in the way described above.

Does anyone have any suggestions?

Regards,
Niall



****************************************************************************   
***************  Department of Agriculture and Food ******************

The information contained in this email and in any attachments is 
confidential and is designated solely for the attention and use of 
the intended recipient(s). This information may be subject to legal 
and professional privilege.  If you are not an intended recipient of
this email, you must not use, disclose, copy, distribute or retain 
this message or any part of it. If you have received this email in 
error, please notify the sender immediately and delete all copies
of this email from your computer system(s).
****************************************************************************   


****************************************************************************   
****************  An Roinn Talmhaíochta Agus Bia  *******************

Tá an t-eolais san ríomhphost seo, agus in aon ceangláin leis, 
faoi phribhléid agus faoi rún agus le h-aghaigh an seolaí amháin.
D’fhéadfadh ábhar an seoladh seo bheith faoi phribhléid 
profisiúnta nó dlíthiúil. Mura tusa an seolaí a bhí beartaithe 
leis an ríomhphost seo a fháil, tá cosc air, nó aon chuid de, 
a úsáid, a chóipeál, nó a scaoileadh.  Má tháinig sé chugat de 
bharr dearmad, téigh i dteagmháil leis an seoltóir agus scrios an 
t-ábhar ó do ríomhaire le do thoil.     
****************************************************************************


Re: Problem committing records using IBATIS in embedded jar file

Posted by Brandon Goodin <br...@gmail.com>.
Please post your dao.xml and sqlmap-config.xml from ProjectA and ProjectB.
Also, post any supporting code that is failing to commit (code that loads
the dao.xml, code that loads sqlmapconfig.xml, code that starts and commits
the transaction, etc....). This will help us to see what you are doing and
will likely get you an answer that is not a guess.

Brandon

On 12/12/06, Ross, Niall <Ni...@agriculture.gov.ie> wrote:
>
> Hi,
>
> I am having the following problem and I was wondering had anyone
> encountered this type of thing before
> or could someone possibly lend a hand with a solution.
>
> Ok here's the setup:
>
> Project A uses ibatis to control all transaction management functionality
> needed.
> Project B also uses ibatis but also includes Project A in the form of a
> jar.
>
> We are currently developing in Project B and wish to prevent duplication
> of code so we
> want to re-use the DB related calls from Project A within Project B
> through the Project A jar.
> With me so far???
>
> When we execute code from Project A that alters a table in some way we use
> the DAOManager to
> start, end and commit the transactions. This is working in Project A.
>
> The problem occurs when trying to execute this same code through the jar
> file from within Project B
> as when we the execute the code the transaction does not get committed at
> all. It will however be committed
> when I physically shutdown my local appserver.
>
> It seems to me that there is some sort of IBATIS config conflict problem
> when trying to execute transaction management
> in the way described above.
>
> Does anyone have any suggestions?
>
> Regards,
> Niall
>
>
>
>
> ****************************************************************************
> ***************  Department of Agriculture and Food ******************
>
> The information contained in this email and in any attachments is
> confidential and is designated solely for the attention and use of
> the intended recipient(s). This information may be subject to legal
> and professional privilege.  If you are not an intended recipient of
> this email, you must not use, disclose, copy, distribute or retain
> this message or any part of it. If you have received this email in
> error, please notify the sender immediately and delete all copies
> of this email from your computer system(s).
>
> ****************************************************************************
>
>
>
> ****************************************************************************
> ****************  An Roinn Talmha+AO0-ochta Agus Bia  *******************
>
> T+AOE an t-eolais san r+AO0-omhphost seo, agus in aon ceangl+AOE-in leis,
> faoi phribhl+AOk-id agus faoi r+APo-n agus le h-aghaigh an seola+AO0
> amh+AOE-in.
> D+IBk-fh+AOk-adfadh +AOE-bhar an seoladh seo bheith faoi phribhl+AOk-id
> profisi+APo-nta n+APM dl+AO0-thi+APo-il. Mura tusa an seola+AO0 a bh+AO0
> beartaithe
> leis an r+AO0-omhphost seo a fh+AOE-il, t+AOE cosc air, n+APM aon chuid
> de,
> a +APo-s+AOE-id, a ch+APM-ipe+AOE-l, n+APM a scaoileadh.  M+AOE
> th+AOE-inig s+AOk chugat de
> bharr dearmad, t+AOk-igh i dteagmh+AOE-il leis an seolt+APM-ir agus scrios
> an
> t-+AOE-bhar +APM do r+AO0-omhaire le do thoil.
>
> ****************************************************************************
>
>

Re: Problem committing records using IBATIS in embedded jar file

Posted by Joakim Olsson <ar...@lingonpaj.com>.
Are you by chance using Oracle from Geronimo?

I had exactly this problem when I switched to Geronimo. The cause was some
problem in the DBPool-setup.

Shutdown Geronimo, edit the file <geronimo-root>/var/config/config.xml. In
the <gbean> for your DBPool, add <attribute
name="CommitBeforeAutocommit">true</attribute>

/Joakim


> Hi,
>
> I am having the following problem and I was wondering had anyone
> encountered this type of thing before
> or could someone possibly lend a hand with a solution.
>
> Ok here's the setup:
>
> Project A uses ibatis to control all transaction management functionality
> needed.
> Project B also uses ibatis but also includes Project A in the form of a
> jar.
>
> We are currently developing in Project B and wish to prevent duplication
> of code so we
> want to re-use the DB related calls from Project A within Project B
> through the Project A jar.
> With me so far???
>
> When we execute code from Project A that alters a table in some way we use
> the DAOManager to
> start, end and commit the transactions. This is working in Project A.
>
> The problem occurs when trying to execute this same code through the jar
> file from within Project B
> as when we the execute the code the transaction does not get committed at
> all. It will however be committed
> when I physically shutdown my local appserver.
>
> It seems to me that there is some sort of IBATIS config conflict problem
> when trying to execute transaction management
> in the way described above.
>
> Does anyone have any suggestions?
>
> Regards,
> Niall
>
>
>
> ****************************************************************************
> ***************  Department of Agriculture and Food ******************
>
> The information contained in this email and in any attachments is
> confidential and is designated solely for the attention and use of
> the intended recipient(s). This information may be subject to legal
> and professional privilege.  If you are not an intended recipient of
> this email, you must not use, disclose, copy, distribute or retain
> this message or any part of it. If you have received this email in
> error, please notify the sender immediately and delete all copies
> of this email from your computer system(s).
> ****************************************************************************
>
>
> ****************************************************************************
> ****************  An Roinn Talmha+AO0-ochta Agus Bia  *******************
>
> T+AOE an t-eolais san r+AO0-omhphost seo, agus in aon ceangl+AOE-in leis,
> faoi phribhl+AOk-id agus faoi r+APo-n agus le h-aghaigh an seola+AO0
> amh+AOE-in.
> D+IBk-fh+AOk-adfadh +AOE-bhar an seoladh seo bheith faoi phribhl+AOk-id
> profisi+APo-nta n+APM dl+AO0-thi+APo-il. Mura tusa an seola+AO0 a bh+AO0
> beartaithe
> leis an r+AO0-omhphost seo a fh+AOE-il, t+AOE cosc air, n+APM aon chuid
> de,
> a +APo-s+AOE-id, a ch+APM-ipe+AOE-l, n+APM a scaoileadh.  M+AOE
> th+AOE-inig s+AOk chugat de
> bharr dearmad, t+AOk-igh i dteagmh+AOE-il leis an seolt+APM-ir agus scrios
> an
> t-+AOE-bhar +APM do r+AO0-omhaire le do thoil.
> ****************************************************************************
>
>
>