Fidel Viegas | 1 Oct 2008 10:43
Picon

Executing Firebird 2.0+ new insert ... returning ... statement

Hello all,

I am trying to execute the new insert statement with return values
introduced in Firebird 2.0+. Has anyone successfully executed this?

I tried using <insert>, but that does not work. I tried using a
select, and that does not work either. In normal JDBC I do something
like this:

Resultset rs = statement.executeQuery("insert into xxx (xx, xx, xx...)
values (..., ..., ...) returning id"),

and this works ok. I was wondering how to achieve the same using
iBatis. Has any Firebird user used this feature?

Thanks in advance,

Fidel.

Shannon, Bryan | 2 Oct 2008 16:18
Picon
Favicon

RE: P6Spy for logging SQL with value using iBatis in JDK 1.5

I have used P6Spy with iBatis quite successfully... Just follow along
with the documentation.

Also, try a great program I found out there called "Elvyx" that will
also let you record your sql statements (with and without placeholders).

These products both work by WRAPPING your existing jdbc driver (no
matter which it is) and recording metrics about the call before passing
the actual jdbc call to your own driver.  I've had both of these wrap up
Sybase's jconnect, jTds, and mysql's jdbc drivers with no problem.

You configure each with what your actual jdbc url and options are, then
in your own java code, you set up your jdbc url to be the p6spy or elvyx
driver.

Elvyx is very helpful, as it stores your historical metrics in an
in-memory database (which you can query to get your own statistics) and
it has a nice front end that has a pie chart to show you up-front which
queries are taking the longest time to execute.  

Either of these programs will do what you want, and either proxy driver
will most likely be able to be set up with Websphere's JNDI with no
problem.  (p6spy uses a config file that might be tricky, it has to be
somewhere in Webshere's classpath) and Elvyx uses encoded parameters
sent to it's own jdbc url to determine how it should set up your own
(real) jdbc driver.  I'd recommend either of these to any iBatis or even
Hibernate or straight jdbc users.

(Comes in especially handy when you're trying to get performance metrics
for certain queries, etc.)
(Continue reading)

Tokajac | 2 Oct 2008 20:12
Picon
Favicon

iBatis AS400 Stored Procedure call Hanging trouble


Hello,

I'm invoking a stored procedure from iBatis and database remains to hang:
http://opensource.atlassian.com/confluence/oss/display/IBATIS/How+do+I+call+a+stored+procedure

I'm stucked with this for a while

I'd appreciate any hint!

Regards
--

-- 
View this message in context: http://www.nabble.com/iBatis-AS400-Stored-Procedure-call-Hanging-trouble-tp19784745p19784745.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

Jeff Butler | 2 Oct 2008 21:01
Picon

Re: iBatis AS400 Stored Procedure call Hanging trouble

In my experience, AS/400 hangs are usually caused by an error in the
library list, or some other error in the procedure on the AS/400 side.
 Have the AS/400 operator look for an error message in the QSYSOPR
queue - it should give you the detail of what's wrong.

Jeff Butler

On Thu, Oct 2, 2008 at 1:12 PM, Tokajac <imre_tokai <at> hotmail.com> wrote:
>
> Hello,
>
> I'm invoking a stored procedure from iBatis and database remains to hang:
> http://opensource.atlassian.com/confluence/oss/display/IBATIS/How+do+I+call+a+stored+procedure
>
>
>
> I'm stucked with this for a while
>
> I'd appreciate any hint!
>
>
> Regards
> --
> View this message in context: http://www.nabble.com/iBatis-AS400-Stored-Procedure-call-Hanging-trouble-tp19784745p19784745.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Chema | 3 Oct 2008 12:53
Picon

java.sql.SQLException: You cannot commit during a managed transaction

Hello:

I'm using JBoss 3.2 and EJB 2.0 with iBatis 2.3.0
I've got configured a external transaction manager in SQLMap
configuration file.

When an EJB component ( session bean ) tries to delete record using by
iBatis sqlMap client, JBoss retrieve this
error:

11:02:09,406 ERROR [Connection] Error calling Connection.commit:
java.sql.SQLException: You cannot commit during a managed transaction!
        at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:525)

This error happens when I perform this

sqlMap.startTransaction();
sqlMap.delete("deleteRecords", param);
sqlMap.commitTransaction();
sqlMap.endTransaction();

And with a single call (automatic transaction):

sqlMap.delete("deleteRecords", param);

I would like to delegate all transaction issues to external
transaction manager ( in this case, JBoss)
How I can solved this ? Any w/a ?

Thanks !!
(Continue reading)

Kai Grabfelder | 3 Oct 2008 14:38
Picon
Favicon

Re: java.sql.SQLException: You cannot commit during a managed transaction

if you are using CTM (container managed transactions), like in your case, you can't start, commit or end
transactions manually. The container is doing this for you.

The following should work
> sqlMap.delete("deleteRecords", param);

If it does not I think your sqlmap configuration is not correct. Could you post it here?

Regards

Kai

--- Original Nachricht ---
Absender: Chema
Datum: 03.10.2008 12:53
> Hello:
> 
> I'm using JBoss 3.2 and EJB 2.0 with iBatis 2.3.0
> I've got configured a external transaction manager in SQLMap
> configuration file.
> 
> When an EJB component ( session bean ) tries to delete record using by
> iBatis sqlMap client, JBoss retrieve this
> error:
> 
> 11:02:09,406 ERROR [Connection] Error calling Connection.commit:
> java.sql.SQLException: You cannot commit during a managed transaction!
>         at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:525)
> 
> 
(Continue reading)

Chema | 3 Oct 2008 15:01
Picon

Re: java.sql.SQLException: You cannot commit during a managed transaction

That doesn't work because sqlMap.delete() performs commit automatically.
I'm using the transaction manager of JBoss , with JNDI/JDBC.
Can I disabled this ? By code is not possible because Jboss TX manager
throws a SQLExeception.
Another w/a ?

Thanls !

2008/10/3 Kai Grabfelder <nospam <at> kinokai.de>:
> if you are using CTM (container managed transactions), like in your case, you can't start, commit or end
> transactions manually. The container is doing this for you.
>
> The following should work
>> sqlMap.delete("deleteRecords", param);
>
> If it does not I think your sqlmap configuration is not correct. Could you post it here?
>
> Regards
>
> Kai
>
> --- Original Nachricht ---
> Absender: Chema
> Datum: 03.10.2008 12:53
>> Hello:
>>
>> I'm using JBoss 3.2 and EJB 2.0 with iBatis 2.3.0
>> I've got configured a external transaction manager in SQLMap
>> configuration file.
>>
(Continue reading)

Kai Grabfelder | 3 Oct 2008 16:23
Picon
Favicon

Re: java.sql.SQLException: You cannot commit during a managed transaction

sqlMap.delete() performs a commit? That should not be the case if the tx manager is configured correctly.
Whats your configuration? Could you please also try updating ibatis to 2.3.4, 2.3.0 is really old...

Regards

Kai

--- Original Nachricht ---
Absender: Chema
Datum: 03.10.2008 15:01
> That doesn't work because sqlMap.delete() performs commit automatically.
> I'm using the transaction manager of JBoss , with JNDI/JDBC.
> Can I disabled this ? By code is not possible because Jboss TX manager
> throws a SQLExeception.
> Another w/a ?
> 
> Thanls !
> 
> 
> 
> 
> 
> 
> 
> 
> 2008/10/3 Kai Grabfelder <nospam <at> kinokai.de>:
>> if you are using CTM (container managed transactions), like in your case, you can't start, commit or end
>> transactions manually. The container is doing this for you.
>>
>> The following should work
(Continue reading)

Vadim | 3 Oct 2008 17:47
Picon

Re: Spring, Ibatis & Oracle 10G

You are querying for list - Ibatis tries to map resultset obtained after the call, which is absent, so you get no data. You should use sqlMapTemplate().update("procedure", params) and check for the out parameter in the 'params', under the key specified in the sqlmap.xml parameterMap (aParameterMap in your case) associated with that procedure.

On Fri, Oct 3, 2008 at 2:12 PM, <lucy.x.cameron <at> jpmorgan.com> wrote:
Hi,

I'm using spring &  ibatis sql maps  to call an Oracle (10G) stored
procedure. I can successfully call the stored proc from sql plus however
when I use my code I get no data returned and no error thrown.
The stored procedure  takes in 7 parameters -  6 input and 1 output, the
output being a of type sys_refcursor. I can't see where I'm going wrong...
is there a way I can debug to see exactly whats being called ? Or am I
handling the cursor incorrectly ? Or is my application context incorrect ?

here's my sql map relating to the proc (mapToClass is just a java bean
representing )


     <parameterMap id ="aParameterMap"  class="map">

           <parameter property="parameter1" jdbcType="VARCHAR" javaType=
"java.lang.String" mode="IN"/>
           <parameter property="parameter2" jdbcType="DATE" javaType=
"java.util.Date" mode="IN"/>
           <parameter property="parameter3" jdbcType="VARCHAR" javaType=
"java.lang.String" mode="IN"/>
           <parameter property="parameter4" jdbcType="VARCHAR" javaType=
"java.lang.String" mode="IN"/>
           <parameter property="parameter5" jdbcType="VARCHAR" javaType=
"java.lang.String" mode="IN"/>
           <parameter property="parameter6" jdbcType="CHAR" javaType=
"java.lang.String" mode="IN"/>
           <parameter property="parameter7" jdbcType="ORACLECURSOR" mode=
"OUT" resultMap="mapToClass"/>

     </parameterMap>

     <procedure id="aStoredProcCall" parameterMap="aParameterMap">
           {call get_some_data(?, ?, ?, ?, ?, ?, ?) }
     </procedure>

The java code



       Map map = new HashMap();

       map.put("parameter1", "valueparameter1");
       map.put("parameter2", "valueparameter2");
       map.put("parameter3", "valueparameter3");
       map.put("parameter4", "valueparameter4");
       map.put("parameter5", "valueparameter5");
       map.put("parameter6", "valueparameter6");


     List data
=getSqlMapClientTemplate().queryForList("aStoredProcCall",map);

ApplicationOnContext

     <bean id="sqlMapClient"
           class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
           <property name="configLocation"
                 value="classpath:sqlmap-config.xml" />
           <property name="dataSource" ref="dataSource" />
     </bean>

     <bean id="theDao"
           class="the.java.class.that.calls.queryforlist()">
           <property name="sqlMapClient" ref="sqlMapClient" />
     </bean>




Generally, this communication is for informational purposes only
and it is not intended as an offer or solicitation for the purchase
or sale of any financial instrument or as an official confirmation
of any transaction. In the event you are receiving the offering
materials attached below related to your interest in hedge funds or
private equity, this communication may be intended as an offer or
solicitation for the purchase or sale of such fund(s).  All market
prices, data and other information are not warranted as to
completeness or accuracy and are subject to change without notice.
Any comments or statements made herein do not necessarily reflect
those of JPMorgan Chase & Co., its subsidiaries and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.
Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to UK legal entities.

wuxi_root-dis | 3 Oct 2008 18:08
Picon
Favicon

How do you pass arguemtns when you use "in" a statement?

Are there elegant way to do this?   Thanks in advance!

Gmane