[Progress Communities] [Progress OpenEdge ABL] Forum Post: Options for mapping between .Net DataTable and ABL temp-table.

Status
Not open for further replies.
D

dbeavon

Guest
The "CLR bridge" can run within the memory space of the PASOE msagent (_mrpoapsv). Given the functionality of the "CLR bridge", and the co-habitation of .Net and ABL in the same process, I was hoping it would be fast and easy to convert back and forth between ADO.Net DataTable and ABL Temp-Table. I don't personally have much experience with "GUI for .Net" and only started using the CLR bridge in the context of PASOE. I originally assumed that DataTable mappings would happen as part of GUI for .Net, and that they would be fast. But apparently another type of a strategy is used for binding to WinForms. ... see documentation.progress.com/.../index.html .. from what I can gather, the strategy seems to be based on ProBindingSource, and doesn't involve moving any data from ABL into an ADO.Net DataTable. I see that this is an old topic and has come up before. I just wanted to ask whether there are any new approaches to consider using in OE 11.7.4 (on windows). Here are some prior posts that I found, and one KB article: Put content of a temp-table into a .Net DataTable - Forum - OpenEdge Development - Progress Community Convert TEMP-TABLE to System.Data.DataTable - Forum - OpenEdge Development - Progress Community Progress KB - Is it possible to map between an ABL Temp-Table and a .NET System.Data.DataTable? Here is a list of the approaches that I've read about thus far: 1) Step through the temp-table manually (and probably in a non-generic way) and copy data on a row-by-row, field-by-field basis. 2) Somehow use ProBindingSource and .Net reflection to read or write ABL TT, given a .Net DataTable 3) Use Progress Write-Xml and the DataTable ReadXml methods. All of these seem like they would perform poorly when scaled up to 100,000 rows or so, right? I am planning on doing some of my own benchmarking but I'm not that optimistic. In the context of PASOE, there may be additional considerations. For example the approach #3 might even have an additional delay due to a somewhat artificial concurrency conflict (see PERFORMANCE OF CONCURRENT READ-XML CALLS ON PASOE SLOWER - Forum - OpenEdge General - Progress Community ). Can anyone tell me if there are some faster approaches that would allow us to quickly map back and forth between DataTables and temp-tables? I'm hoping for an approach that can be done (1) in a generic way rather than requiring work that is tailored to each table, (2) totally in-memory, rather than using files on disk, and (3) is very fast and involves minimal CPU for serialization/deserialization. One thought that came to mind was to possibly piggy-back on the ABL IMPORT and EXPORT statements. IMPORT may be the fastest possible way to deserialize raw data from an external source. The only problem with this might be that an ADO.Net DataTable doesn't natively support the same format and may take some work to support it in a generic way. Any ideas would be appreciated. Sorry for digging up this old topic once again. It would be nice if there was a built-in feature for quickly mapping data back and forth. The CLR bridge has been available for quite some time, and DataTables and Temp-Tables are used very frequently for data storage (one in the CLR and the other in the AVM). It seems like there should be a lightning-fast way to map data back and forth between them!

Continue reading...
 
Status
Not open for further replies.
Top