Accessing SQL from LLBL

Posts   
 
    
Robert Q
User
Posts: 3
Joined: 03-Jan-2007
# Posted on: 03-Jan-2007 19:47:08   

Hi, I've been tasked with trying to extract the SQL LLBL generates per query as to move it to another service later via MQ. In short, we want to extract the SQL for a specific operation INSERT, UPDATE, DELETE at the time we do a "SaveEntity" within an adapter.

The purpose is to offload very large numbers of INSERTS, UPDATES, and DELETES to another service/machine the will more slowly update large batches allowing us to regulate the statements based on load.

So, does any way exist to retrieve the SQL generated already populated with the data?

Thanks in advance for any help you can give.smile

jaschag
User
Posts: 79
Joined: 19-Apr-2006
# Posted on: 03-Jan-2007 22:01:21   

Robert wrote:

Hi, I've been tasked with trying to extract the SQL LLBL generates per query as to move it to another service later via MQ. In short, we want to extract the SQL for a specific operation INSERT, UPDATE, DELETE at the time we do a "SaveEntity" within an adapter.

The purpose is to offload very large numbers of INSERTS, UPDATES, and DELETES to another service/machine the will more slowly update large batches allowing us to regulate the statements based on load.

So, does any way exist to retrieve the SQL generated already populated with the data?

Thanks in advance for any help you can give.smile

Sounds like a strange requirement but why not send UnitOfWork2 objects to the remote machine (they are serializable)?

Robert Q
User
Posts: 3
Joined: 03-Jan-2007
# Posted on: 03-Jan-2007 22:15:47   

jaschag wrote:

Robert wrote:

Hi, I've been tasked with trying to extract the SQL LLBL generates per query as to move it to another service later via MQ. In short, we want to extract the SQL for a specific operation INSERT, UPDATE, DELETE at the time we do a "SaveEntity" within an adapter.

The purpose is to offload very large numbers of INSERTS, UPDATES, and DELETES to another service/machine the will more slowly update large batches allowing us to regulate the statements based on load.

So, does any way exist to retrieve the SQL generated already populated with the data?

Thanks in advance for any help you can give.smile

Sounds like a strange requirement but why not send UnitOfWork2 objects to the remote machine (they are serializable)?

As far as the requirement...I reiterate, I've been tasked.

**Serialization was considered and dispatched as being too large for transport and needing to be reconstituted at the other end (among other reasons). Thus, the process was considered too slow.

This is one of those instances where it either must be demonstrated it can’t be done without much work, or it is too slow. Thus, the sooner I can get an answer one way or another, the better.

Thanks for your answer.**

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 04-Jan-2007 04:29:19   

You can override OnSaveEntity of the DataAccessAdapter to get the query. You should be aware the the query will be executed anyway.

You can do this in the DataAccessAdapter that is generated using the usercoderegion or by creating your own DataAccessAdapter


#region Custom DataAccessAdapter code.
        
// __LLBLGENPRO_USER_CODE_REGION_START CustomDataAccessAdapterCode
protected override void OnSaveEntity(IActionQuery saveQuery, IEntity2 entityToSave)
{
    base.OnSaveEntity(saveQuery, entityToSave);
}
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion