ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » getjdbctype4connection

Post new topic  Reply to topic
 getjdbctype4connection « View previous topic :: View next topic » 
Author Message
rsk33
PostPosted: Sat Mar 28, 2015 12:06 pm    Post subject: getjdbctype4connection Reply with quote

Centurion

Joined: 21 Aug 2006
Posts: 141

Hi,

I am using the getjdbctype4connection in my JCN . For testing i use simple insert and observed it is working 2 times out of 10 times. i am using ver 8.0.0.3 broker and toolkit 8.0.0.4. Any issue with the version or do i need to
retry till i get connection from the pool.

regards
Back to top
View user's profile Send private message
nelson
PostPosted: Sat Mar 28, 2015 12:36 pm    Post subject: Re: getjdbctype4connection Reply with quote

Partisan

Joined: 02 Oct 2012
Posts: 313

rsk33 wrote:
For testing i use simple insert and observed it is working 2 times out of 10 times.


What do you mean by it is working 2 times out of 10? What errors are you getting?
Back to top
View user's profile Send private message
rsk33
PostPosted: Sat Mar 28, 2015 12:49 pm    Post subject: Reply with quote

Centurion

Joined: 21 Aug 2006
Posts: 141

Hi Nelson

Thanks for the reply. It is not inserting the row all the time and there is no exception.

regards
Back to top
View user's profile Send private message
nelson
PostPosted: Sat Mar 28, 2015 1:01 pm    Post subject: Reply with quote

Partisan

Joined: 02 Oct 2012
Posts: 313

rsk33 wrote:
Hi Nelson

Thanks for the reply. It is not inserting the row all the time and there is no exception.

regards


Have you debugged the flow? How are you sure that the row should be inserted all the times? I'm afraid the information you have provided does not help much to determine the cause of the problem. You have to share more details (code, traces, etc.).
Back to top
View user's profile Send private message
rsk33
PostPosted: Sat Mar 28, 2015 1:09 pm    Post subject: Reply with quote

Centurion

Joined: 21 Aug 2006
Posts: 141

This is a simple flow mqinputnode -- JCN. The JCN Code is

Code:
try {
             

              Connection conn = getJDBCType4Connection("JDBCDEVXE",
                           JDBC_TransactionType.MB_TRANSACTION_AUTO);

              // Example of using the Connection to create a java.sql.Statement 
              Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
                           ResultSet.CONCUR_READ_ONLY);
             
              stmt.execute("INSERT INTO TABLE1 (COLUMN1) VALUES ('fff')");

            } catch (SQLException sqx ){
              sqx.printStackTrace();
            } finally {
           
            }   
}


I have run the program repeatedly and i have found the data is not inserted all the time.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Mar 28, 2015 1:23 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

But you only print the stack trace and not the message from the sql exception... Also should you not throw an MbUserException in that case to inform the flow of the error?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
rsk33
PostPosted: Sat Mar 28, 2015 1:31 pm    Post subject: Reply with quote

Centurion

Joined: 21 Aug 2006
Posts: 141

i have debug the code to see there is any exception in the code so that there is failure to insert the data. But never seen any exception.
Back to top
View user's profile Send private message
nelson
PostPosted: Sat Mar 28, 2015 9:07 pm    Post subject: Reply with quote

Partisan

Joined: 02 Oct 2012
Posts: 313

fjb_saper wrote:
Also should you not throw an MbUserException in that case to inform the flow of the error?


Agree.

Also, why don't you use stmt.executeUpdate and check the integer result?

Quote:
executeUpdate: Returns an integer representing the number of rows affected by the SQL statement. Use this method if you are using INSERT, DELETE, or UPDATE SQL statements.
Back to top
View user's profile Send private message
ganesh
PostPosted: Sun Mar 29, 2015 4:33 pm    Post subject: Reply with quote

Master

Joined: 18 Jul 2010
Posts: 294

Quote:
stmt.execute("INSERT INTO TABLE1 (COLUMN1) VALUES ('fff')");


Are you trying to insert the same value over and over again? If yes then how did you determine when was the last insert?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » getjdbctype4connection
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.