Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

DataServiceTransaction.setSendChangesToAdapter(true)

Avatar

Former Community Member

Hello

If I set DataServiceTransaction.setSendChangesToAdapter(true)  and the call createItem(), would the new item be persisted in the database? It is not happening but I can see that new item is sent to the clients.

thanks

Rupak

3 Replies

Avatar

Employee

When you set DataServiceTransaction.sendSendChangesToAdapter(true)  and the  call createItem(), the call is sent to the adapter and ultimately your assembler implementation. It is up to the assembler to do whatever it wants to there.

You should enable LCDS debug logging to see if the changes are actually  being pushed to the adapter and ultimately your Assembler  implementation.

Rohit

Avatar

Former Community Member

Rohit,

It doesnot look like from the log below that the write is happening but the call seems to be going to the assembler/adapter, I have specifically set the assembler to CurrencyAssembler on the entity Currency on the model so that it uses the auto generated CurrencyAssembler instead of default FiberAssembler. Is there anything custom that needs to be done in the model generated CurrencyAssembler.createItem() ?

*** Log Messages below ***

[TWSServer]08/25/2011 11:39:53.864 [DEBUG] [Service.Data.Transaction] Started non-jta data service transaction
[TWSServer]08/25/2011 11:39:53.865 [DEBUG] [Service.Data.Transaction] Sending server message to adapter: Flex Message (flex.data.messages.DataMessage)
    operation = create
    id = {currencyId=537}
    clientId = srv:15DE4097-4B0E-E3B4-E51C-CAF62F69BBAF
    correlationId = null
    destination = TraderWorkStation.Currency
    messageId = srv:15DE4097-4B0E-E3B4-E51C-CAF62F69BBAF:2
    timestamp = 1314286793865
    timeToLive = 0
    body = TraderWorkStation.Currency@238
[TWSServer]08/25/2011 11:39:53.865 [DEBUG] [Service.Data.General] Before TraderWorkStation.Currency.createItem (
    (TraderWorkStation.Currency) {currencyId=537} (11116972) {
        currencyName = Dummy Currency
        currencyCode = ABC
        currencyId = 537
        currencyLastUpdated = Thu Aug 25 11:39:53 EDT 2011
    })
[TWSServer]08/25/2011 11:39:53.869 [DEBUG] [Service.Data.General] After TraderWorkStation.Currency.createItem (
    (TraderWorkStation.Currency) {currencyId=186} (11116972) {
        currencyName = Dummy Currency
        currencyCode = ABC
        currencyId = 186
        currencyLastUpdated = Thu Aug 25 11:39:53 EDT 2011
    })
[TWSServer]08/25/2011 11:39:53.869 [DEBUG] [Service.Data.General] Caching item: TraderWorkStation.Currency:{currencyId=186} (11116972)
[TWSServer]08/25/2011 11:39:53.869 [DEBUG] [Service.Data.Transaction] Committed transaction
[TWSServer]08/25/2011 11:39:53.870 [DEBUG] [Service.Data.General] refreshFill for destination: TraderWorkStation.Currency params: [getAll] (class: java.util.ArrayList) returns: APPEND_TO_FILL
[TWSServer]08/25/2011 11:39:53.875 [DEBUG] [Service.Message] Routing message to FlexClient id:15DE3EF3-5F0E-11CA-4D7C-A6F65AE454FF', MessageClient id: 059BB2CC-1940-20CF-6A0D-0198D81C6FF3
[TWSServer]08/25/2011 11:39:53.882 [DEBUG] [Endpoint.RTMP] Serializing AMF/RTMP push
Version: 3
  (Command method=receive (0) trxId=null)
    (Externalizable Object #0 'DSD')
      (Typed Object #1 'TraderWorkStation.Currency')
        currencyName = "Dummy Currency"
        currencyCode = "ABC"
        currencyId = 186
        currencyLastUpdated = Thu Aug 25 11:39:53 EDT 2011
"TraderWorkStation.Currency"
(Object #3)
"srv:15DE4097-4B0E-E3B4-E51C-CAF62F69BBAF:2"
1.314286793865E12
(Byte Array #4, Length 16)
(Typed Object #5 'flex.data.ItemIdentity')
        currencyId = 186

[TWSServer]08/25/2011 11:39:53.883 [DEBUG] [SocketServer.General] Thread[http-bio-8180-exec-8,5,main] registering write interest for Connection '6818173'.
[TWSServer]08/25/2011 11:39:53.888 [DEBUG] [SocketServer.General] Thread[my-rtmp-SocketServer-Reactor1,5,main] unregistering write interest for Connection '6818173'.
[TWSServer]08/25/2011 11:39:53.888 [DEBUG] [SocketServer.General] Thread[my-rtmp-SocketServer-Reactor1,5,main] Connection '6818173' starting a write.
[TWSServer]08/25/2011 11:39:53.888 [DEBUG] [SocketServer.General] Thread[my-rtmp-SocketServer-Reactor1,5,main] Connection '6818173' finished a write. 262 bytes were written.
[TWSServer]08/25/2011 11:39:53.889 [DEBUG] [Service.Message] Routing message to FlexClient id:15DE3EF3-5F0E-11CA-4D7C-A6F65AE454FF', MessageClient id: 059BB2CC-1940-20CF-6A0D-0198D81C6FF3
[TWSServer]08/25/2011 11:39:53.947 [DEBUG] [Endpoint.RTMP] Serializing AMF/RTMP push
Version: 3
  (Command method=receive (0) trxId=null)
    (Externalizable Object #0 'DSU')
      (Array #1)
        [0] = (Typed Object #2 'flex.data.UpdateCollectionRange')
          position = 4
          identities = (Array #3)
            [0] = (Typed Object #4 'flex.data.ItemIdentity')
              currencyId = 186
          updateType = 0
          size = 1
"TraderWorkStation.Currency"
(Object #5)
"srv:15DE4097-4B0E-E3B4-E51C-CAF62F69BBAF:3"
1.314286793871E12
(Byte Array #6, Length 16)
17
(Array #7)
        [0] = "getAll"
false
1

[TWSServer]08/25/2011 11:39:53.947 [DEBUG] [SocketServer.General] Thread[http-bio-8180-exec-8,5,main] registering write interest for Connection '6818173'.
[TWSServer]08/25/2011 11:39:53.947 [DEBUG] [SocketServer.General] Thread[my-rtmp-SocketServer-Reactor1,5,main] unregistering write interest for Connection '6818173'.
[TWSServer]08/25/2011 11:39:53.948 [DEBUG] [SocketServer.General] Thread[my-rtmp-SocketServer-Reactor1,5,main] Connection '6818173' starting a write.
[TWSServer]08/25/2011 11:39:53.948 [DEBUG] [SocketServer.General] Thread[my-rtmp-SocketServer-Reactor1,5,main] Connection '6818173' finished a write. 278 bytes were written.
[TWSServer]08/25/2011 11:39:53.948 [DEBUG] [Service.Remoting] Adapter 'java-object' called 'com.kuberre.hansa.twsserver.control.HansaApiMgr.fetchAllData(java.util.Arrays$ArrayList (Collection size:0)
)'
[TWSServer]08/25/2011 11:39:53.948 [DEBUG] [Service.Remoting] Result: 'null'
[TWSServer]08/25/2011 11:39:53.949 [DEBUG] [Endpoint.AMF] Serializing AMF/HTTP response
Version: 3
  (Message #0 targetURI=/3/onResult, responseURI=)
    (Externalizable Object #0 'DSK')
      1.314286793949E12
(Byte Array #1, Length 16)
(Byte Array #2, Length 16)
(Byte Array #3, Length 16)

Avatar

Former Community Member

Use the following hibernate settings...

<

annotation name="DMS">

<item name="datasource">java:comp/env/ALGODB</item>

<item name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</item>

<item name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JOTMTransactionManagerLookup</item>

<item name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</item>

<item name="ServerGeneratedEntities">false</item>

</annotation>