(edit: ) For v2 we consider low-level methods to fill entities with a call to a proc. How this is done and what thick rulebook the procedure has to obey to isn't set in stone yet (other features have higher priority at the moment). If support for procs was easy and reliable, it would have been implemented a long time ago. I hope you understand that. Also you've to understand that initially llblgen pro was meant to be solely using procedures for persistence logic however this turned out to be not workable at all and we had to drop 3+ months of work and start over. These things happen, but I'd like you to know that we're not refusing proc support just because it might look like we don't like procs, but because it will very likely result in problems for our users and we don't like that to happen.
WayneBrantley wrote:
I of course completely disagree. It seems you have taken an extreme view of this situation. Instead consider that there are a great MANY procs that we create/control and not supporting procs with the same level of features as the rest of your product really hurts us (and the product - which I love and am only trying to improve it to my situations!). Especially if you look into the future where .net code is in the proc!
You can trust me: .NET code won't be in the procedures. Oracle developers (that is: developers of Oracle db engine) told me that not a lot of people use Java in stored procs on Oracle, despite the effort they've put into it. For some 'fire and forget' procs, it might be helpful, but in most cases, it's not useful: SQL is much more powerful. I would be very surprised if this would be different on Sqlserver. Of course, a function here and there might be CLR code, but compared to the SQL part, that's pretty minor. Add to that the cumbersome way how .NET code has to be maintained in sqlserver and I can assure you most DBA's will definitely move away from .NET code in sqlserver.
DataAccess can be done in various ways. Using an O/R mapper which generates SQL is one, using a pre-defined DAL with procs is another. Mixing the two is a marriage doomed to fail, and if you don't believe me, that's fine, but I've spend months of work on proc support alone so I know a little about what kind of problems one might run into.
It's easy to say: "just support procedures", but it's in the details where this goes wrong. For example, the procedures have to obey a large set of strict rules: not obeying one detail of these rules and the system falls apart. For example, how would you write the procs for a prefetch path of 4 nodes deep? With filters per node, sort clauses per node etc. ?
Data processing procedures which return resultsets can still be used: call the proc via the retrieval proc call mechanism in llblgen pro. Ok, you can't fill an entityset with it, but who combines dataprocessing mechanisms with data retrieval mechanisms?
I am not sure what you mean by 'reliance on a resultset with respect to the format of the entity is too fragile'. Please clarify.
Stored procedure returns resultset with fields F1, F2, F3 and F4. You want to push that into a set of entities of type E which has fields F1, F2, F3. Be aware: these fields are based on the table/view the entity is mapped on. Now, the proc gets changed and it returns F1, F2, A3 and F4. Poof... a crash at runtime and it's not easy to tell where it broke. The runtime will likely hold up and fill F1 and F2 in the entity, but won't fill F3 as that's not in the resultset. So this leads to unexpected behavior in the application. The worst kind of errors you can run into.
This is even worse when you consider hierarchical entities, i.e. entities which are in an inheritance hierarchy. The fields are aligned in a special way, so the fields can be used to determine the type of the entity to instantiate. This makes writing a proc for that even more cumbersome. Not in the beginning of the project perhaps, but after a year or so in production when a feature has to be added, no-one knows these tiny little details and it's likely you run into these problems. There's no way to determine this earlier than at runtime because there's no way to pre-check the resultset with the mapping data. Ok, with running the proc, but that's not always possible if the proc alters data, you don't want to run procs which alter data to test resultset mappings.