cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with transactions via JDBC connection

former_member186148
Active Participant
0 Kudos

Hello!

We have a HANA tables with client WDJ application which reads and writes data to this tables via JDBC driver (ngdbc.jar). Read and write performs direct to tables without SQL proceduers. Client application performs write in transaction mode. In DEV HANA system everything is OK, but in QAS the error "cannot change this transaction's access mode from read-only to update directly: please use "SET TRANSACTION READ WRITE" statement first" throwed on the client application's side during first executing of SQL command. We added executing of this SQL instruction before any other call but the error still occured. How we can to resolve this error?

Regards,

Lev

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Has the issue of [Caused by: com.sap.db.jdbc.exceptions.SQLTransactionRollbackExceptionSapDB: [129]: transaction rolled back by an internal error: cannot change this transaction's access mode from read-only to update directly: please use "SET TRANSACTION READ WRITE" statement first] been resolved?

former_member185086
Active Contributor
0 Kudos

Hi,

I am facing the same issue in my application, any help will be highly appreciated.

Thanks

Satish Kuamr

former_member186148
Active Participant
0 Kudos

Hello!

Unfortunatelly ,we still haven't any solution for this. We're going to collect JDBC traces from DEV and QAS system as Lars supposed above.and post it here. May be someone will find the reason.

I can only mention that our HANA DEV system is single-node and the HANA QAS system is multi-node server.

Regards,

Lev

lbreddemann
Active Contributor
0 Kudos

Hmm... what is special about the user account you use in QAS?

The "normal" transaction mode enables the user to read and change data.

Have you tried to change data with the same logon in SAP HANA studio?

- Lars

former_member186148
Active Participant
0 Kudos

Hello Lars!

As I know there is no special for user account in QAS.

Basis team said me that everything works fine in SAP HANA Studio. In Stusio they tried exactly the same commands that called from client.



Regards,

Lev

lbreddemann
Active Contributor
0 Kudos

Hmm... in that case my next step would be to generate JDBC traces on both systems and compare them.

former_member186148
Active Participant
0 Kudos

Now my colleagues trying to figure out how to make traces for ngdbc.jar in HP-UX...

lbreddemann
Active Contributor
0 Kudos

That's in the documentation - nothing to "figure out here"... and it's the very same for all platforms.

former_member186148
Active Participant
0 Kudos

Hello Lars.

Weve got the traces from both systems. In QAS system there're some records:


<Packet SessionID=1718017426009369 PacketCount=3 VarpartLength=288 VarpartSize=29968 NumberOfSegments=1 PacketOptions=0>

  <Segment Reply Length=288 Offset=0 NoOfParts=2 Index=1 SegmentKind=5 FunctionCode=Delete(4)>

    <Part PartKind=Error_C Attributes=0 [] ArgCount=1 SegmOffs=0 BufLen=200 BufSize=29928>

      <PartBuffer>

        [81 00 00 00 00 00 00 00 b5 00 00 00 01 34 30 30 30 30 74 72 61 6e 73 61 63 74 69 6f 6e 20 72 6f 6c 6c 65 64 20 62 61 63 6b 20 62 79 20 61 6e 20 69 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 3a 20 63 61 6e 6e 6f 74 20 63 68 61 6e 67 65 20 74 68 69 73 20 74 72 61 6e 73 61 63 74 69 6f 6e 27 73 20 61 63 63 65 73 73 20 6d 6f 64 65 20 66 72 6f 6d 20 72 65 61 64 2d 6f 6e 6c 79 20 74 6f 20 75 70 64 61 74 65 20 64 69 72 65 63 74 6c 79 3a 20 70 6c 65 61 73 65 20 75 73 65 20 22 53 45 54 20 54 52 41 4e 53 41 43 54 49 4f 4e 20 52 45 41 44 20 57 52 49 54 45 22 20 73 74 61 74 65 6d 65 6e 74 20 66 69 72 73 74 02 ]

         ErrorCode=129 SQLState=40000 ErrorPos=0 ErrorText=transaction rolled back by an internal error: cannot change this transaction's access mode from read-only to update directly: please use "SET TRANSACTION READ WRITE" statement first ErrorLevel=1

      </PartBuffer>

    </Part>

    <Part PartKind=StatementContext_C Attributes=0 [] ArgCount=2 SegmOffs=0 BufLen=30 BufSize=29712>

      <PartBuffer>

        [01 21 10 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 04 83 02 00 00 00 00 00 00 ]

       

      </PartBuffer>

    </Part>

  </Segment>

</Packet>

               

In DEV trace there're no such records. What exactly I have to search in these traces?

P.S: our QAS HANA server is multi-node. Can this fact be a reason for errors?

Regards, Lev