If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > db2 connect from server to VM

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-19-03, 02:44
anthwong_168 anthwong_168 is offline
Registered User
 
Join Date: Nov 2003
Posts: 3
db2 connect from server to VM

Hi,

I am very new to db2 & VM. I am trying to insert into the db2 in VM from a server via db2 connect. I have the following error message when the insert is run from a Java program.

INSERT INTO LMSFWS01.FWSCNTRL VALUES ( 'GSAA', 159, 0, 0, 20031119, 182829, 20031119, 182829, 'IBMAusCredHQ01', ' ' , 0 , 0 , ' ' )
19/11/2003 18:28:31 COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][SQLDS/VM] SQL0552N "LMSFWS01" does not have the privilege to perform operation "FO02". SQLSTATE=42502

However, I would be able to run the same insert successfully via a db2 connect window from the server side.

Would anyone be able to give me a bit of hint.

Cheers,
Reply With Quote
  #2 (permalink)  
Old 11-19-03, 07:03
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

You are probably accessing the VM database with two different users IDs. Check if the same user id is used.

The error message says: "User ID LMSFWS01 does not have permission to do the task".

1. Does LMSFWS01 user exist?
2. Does the user have the permission to do the task?

Hope this helps,
Grofaty
Reply With Quote
  #3 (permalink)  
Old 11-19-03, 17:56
anthwong_168 anthwong_168 is offline
Registered User
 
Join Date: Nov 2003
Posts: 3
Quote:
Originally posted by grofaty
Hi,

You are probably accessing the VM database with two different users IDs. Check if the same user id is used.

The error message says: "User ID LMSFWS01 does not have permission to do the task".

1. Does LMSFWS01 user exist?
2. Does the user have the permission to do the task?

Hope this helps,
Grofaty

Hi Grofaty,

Tks for the reply.

Your suggestion is what I guess in the beginning. Then I grant dba to the user "LMSFWS01' & the message change to the following.

INSERT INTO LMS.FWSCNTRL VALUES ( 'GSAA', 159, 0, 0, 20031118, 221022, 20031118, 221022, 'IBMAusCredHQ01', ' ' , 0 , 0 , ' ' )
18/11/2003 10:10:59 PM COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][SQLDS/VM] SQL0911N The current transaction has been rolled back because of a deadlock or timeout. Reason code "68". SQLSTATE=40001

Now I believe this message doesn't reflex the real situation since I can run the insert sql via db2 connect directly without problem.

Do u have more idea pls?
Reply With Quote
  #4 (permalink)  
Old 11-20-03, 01:24
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

You have solved your problem with access rights. That is good news. Now you have problem with locking.

1. Have you tried to execute this SQL more than one time? Somebody has locked your table and after a time the locks could be released. So try this more than one time - just wait couple of secounds.
2. Do you "via command window" make commits? It looks like somebody locks the table and does not release locks from it. Please try to write "commit" on command window to release locks. This probably will not help, but just try.
3. Does your java application makes "commit" after insert statement? Check this out. If doesn't then make commit. The difference between command window and java application is that command windows makes auto-commit after each command (this is default setting and can be changed). On the other hand java application does not make auto-commit, so you have to explicitly define commit statement.

Hope this helps,
Grofaty
Reply With Quote
  #5 (permalink)  
Old 11-20-03, 01:37
anthwong_168 anthwong_168 is offline
Registered User
 
Join Date: Nov 2003
Posts: 3
Hi Grofaty,

Tks for the reply again. Problem solved. Just to share with u. It has nothing related to access privilage, timeout or locking. What I did is I bind all the binding I can find under the db2 connect "Application Binding". Before I just bind the vm one and finally I bind all the binding like mvs, as400 ...
Problem has been solved however I'm not sure by doing that whether it will give a -ve implact to the system catalog.

What do u think?




Quote:
Originally posted by grofaty
Hi,

You have solved your problem with access rights. That is good news. Now you have problem with locking.

1. Have you tried to execute this SQL more than one time? Somebody has locked your table and after a time the locks could be released. So try this more than one time - just wait couple of secounds.
2. Do you "via command window" make commits? It looks like somebody locks the table and does not release locks from it. Please try to write "commit" on command window to release locks. This probably will not help, but just try.
3. Does your java application makes "commit" after insert statement? Check this out. If doesn't then make commit. The difference between command window and java application is that command windows makes auto-commit after each command (this is default setting and can be changed). On the other hand java application does not make auto-commit, so you have to explicitly define commit statement.

Hope this helps,
Grofaty
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On