NHibernate Win Forms Session Management - winforms

I have used NHibernate in web applications before. I must admit that I am still learning NHibernate and do not totally grasp the art of session management. So I would like to use NHibernate within a Win Forms application that I am writing. I hear that session management in a Forms application is a bit different. Sessions must be opened and closed on a conversation basis. Yes? Does anyone know of a good example of this? Or perhaps some cohesive documentation explaining session creation and tear down within a win32 app?
Thanks,
Nick

There is already a pattern established for managing NHibernate sessions in WinForms applications called Conversation per business transaction. A good description can be found here:
http://fabiomaulo.blogspot.com/2008/12/conversation-per-business-transaction.html
http://fabiomaulo.blogspot.com/2009/01/using-conversation-per-business.html
Basically it uses a conversation abstraction: it can start, pause, resume, end. Each operation does automatic session and transaction management. I highly recommend it, definitely worth taking a look.

Here are some good pointers on this subject.

uNHAddins has support for session-per-business-transaction. We are using it on a WinForms app.
http://gustavoringel.blogspot.com/2009/02/unhaddins-persistence-conversation-part.html

Related

What is a good DB for Offline/Online capabilities for a Web Application

My team is developing an appraisals software for real estate on an enterprise level. This application has some special requirements.
The application should work in Online and Offline environment. If the user is working and suddenly Application goes offline User should be able to work offline. All offline work is stored in local database and sync next time to a central database when Application connects to the internet.This application has many users and all will work at the same time on same information.
User local database must be updated all times either other users are working or not. If other users are working all updated information should be available in the local database to ensure when the user goes offline all information is updated.
The question is How to develop this kind of application? Is there any standard way to achieve this target? Is there any standard or non-standard pattern to build this kind of software?
We are planning to use the Angular 2 Framework for our front end development. If anyone has experience with this and can give suggestions on what tech stack we should use, it would be greatly appreciated.
Well, you can use pouchdb as client-side DB and use every DB that uses the CouchDB sync protocol. I have used this stack with an Angular 2 application. (NoSQL)
I also worked with Kinto (PostgreSQL) and Kinto.js. It is not as user-friendly as PouchDB, but I think the documentation has improved since I used it.
And finally, I know about Meteor/Mongo/GroundDB. Meteor is very powerful it's a fully reactive Stack which works really well with the async options you have with angular and rxjs. But think if you have not worked with rxjs or reactive backends it's the hardest to learn. I took me a long time to adapt my coding style to the reactive Behavior of the data flow.
We are also doing an online POS that would work as a point of sale
but we are in constant backend solution for us to set up database that can sync or scale with offline and online .

What is a good base Xamarin Framework for a mobile App?

Hi I've just started a new job and the boss has asked me to find a "base Xamarin Framework" for a mobile app that need the following:
Logging errors (log them locally and then push to a server)
Clearly split Screen/UI stuff from backend stuff (i.e. calling a server or accessing a local database)
Remembering state
Holding user preferences (user settings)
Dealing with timeouts when calling a server
How navigation is managed
Not really sure how to go about finding one or what a good one is, any suggestions would be awesome :)
There's the almighty and beloved MVVMCross. It's widely used in the Xamarin community and it's constantly updated (it'll even have Xamarin.Forms support)
It's a MVVM framework. It means it'll increase the amount of code you can share between your platforms and also make your code easier to maintain and understand due to the separations of concerns. If this is still not enough, it has a lot of plugins that handle many of those tasks you mentioned and a lot more.

suggested architecture / frameworks for collaborative mobile planning app?

I'm designing an app which needs to have some collaboration functionality. So 1 to many users can edit certain attributes of an event they plan together. e.g. the main-admin can change the title, picture etc. while all admin-users could change the date for example.
I would like to get some ideas how one would approach this in the modern world. Are there fancy frameworks etc.
Q: Is the best way storing it centraly on some server or would some peer to peer data storage work?
Q: My gut-feeling is that a web-application would probably be the easiest way, where people work on the object stored on the server instead of trying to sync a local copy with some central repository.
Is this correct?
Q: Are there mobile frameworks which could do the syncing, locking etc for me?
Thank you for some hints and suggestions. I know the questions are a bit broad, but I'm looking for directions not finished solutions. Thank you.
Kind regards
Fred
Some thoughts:
1a) There is no "best" way without a metric for better/best. But yes, having a server is almost certainly simpler, which is probably part of 'best' for most of us.
1b) Actually, there is always a server. Even p2p systems have clients and servers, it's just that every node is both a server and a client.
2) Yes, a web app would certain give you a lot of plumbing for free, & would probably be fastest/cheapest route to a working app. An alternative would be an olde worlde client/server database. A shinier approach might be mobile apps which use a webservice to communicate with a central server.
3) databases do that. But actually, if you use a web app it's probably not hard.
Analogies:
Apart from web apps, version control systems do exactly what you've
just described. they even do offline editting and subsequent merging.
Straightforward CRUD applications against a database also do what
you've just described.
But perhaps I'm under-estimating what you mean by collaboration?

How to develop a rapid database & web application using Sybase and Power Builder?

I am new in Sybase and Power Builder.
What are the best references and web resources to learn them in a useful and fast way ?
For now, I use http://www.sybase.com as my base reference.
Does anyone know good and practical tutorials for Power Builder V.12 .Net ?
From Where I can download a complete version of it and use it for building my application ?
I know the data window is the magical part in Power Builder and I need to know how to create and use a professional data window and how to make interaction and pass paramters between them and also how to dispaly different views like Master-Detail relationship and Tree-Sturcture or List-Structure and so on.
I would like to know the information I need to build a rapid web and database application plus customzing and editing the existing desktop application.
There is a 45 trial version of Powerbuilder which you can download from here:
http://response.sybase.com/forms/PB12Eval
Sybase's books that come with Powerbuilder are fairly comprehensive and quite a good way to get started.
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.infocenter.pb.12.1/doc/html/title.html
I can't help with Powerbuilder but Rob Verschoor's Sypron.nl is the place to pick up Sybase information - there's loads in there from common "gotachas" to quizzes. His quick reference is terrific and well worth investing in.
Well, it all depends on how much experience you already have (not counting Sybase & PB).
Then there is the issue that app development and Db design are completely different disciplines: people who are good at one are rarely good at the other. Assuming you are the app developer, hire a good modeller/DBA. Product manuals are for reference only; you cannot learn how to code; put an app together; what code segments should be deployed where; best practice; etc from them.
To take even reasonable advantage of the DataWindow, you need a good Database (normalised, genuinely relational, security, etc), AND reasonable experience handling the client/server model (send SQL batch to server; receive & process result set).
You need a good PFC Library. The lib that comes with PB is fat as, and very slow. The first thing we do is strip that down, and create our own, to reduce .pbl size and increase speed.
Last but not least, a good handle on stored proc and Transaction rules. That requirement is true for any app, not just Sybase/Pb.
It sort of depends on what you want to do. PB12 comes with 2 IDEs -- PB12.NET is for creating WPF applications in .NET. PB12 Classic is for creating traditional PB applications as well as WinForm and WebForm .NET type applications.
There are some videos available on PB (some free, some paid)
Yakov Werde has a video titled "Essential PowerBuilder Series" that's about $700. You can see a free preview of it here.
Sybase has some free videos and tutorials here.
Also, there are some older PowerBuilder books like "PowerBuilder 9 Advanced Client/Server Development" that may help you. They're a little dated and don't cover any of the .NET stuff, but a lot of the basics are still the same.
The information you are looking for has always been somewhat of a challenge to find. Without all the corporate training I'm not sure how I would have learned as quickly.
If you are like me then learning by example is probably the best way. I'd go to codeplex and get yourself a working (and well designed) application to learn by example.
Also, believe it or not, I have learned a thing or two by reading the online documentation. Considering you are working with a new version of PB you've got your work cut out for you there isn't much out there. You may contact me if you have specific questions, if I have time then I would be happy to help a fellow developer.

Does MSCRM web-service support database transactions?

One would assume with any web-based data application that database transactions would be an integral part of the design. Looking around at CrmService, I can't find anything that suggests that transactional 'CRUD's are available. Is it the case that this is not supported/implemented in MSCRM?
If it is, and i have missed it, could someone please point me in the right direction. I fear coding a whole lot of 'repair code' to cater for errors/exceptions half way through a custom import/registration routine that I have coded.
No, there is no database-like transaction support in CRM. About the closest thing would be registering a plugin/callout that runs PreCreate of a record... if something in there fails, the record itself will not be created, but there could still be steps that did succeed before one that failed.
Well, Dynamics CRM 4.0 does not include transaction support.
But, fortunately, the 5.0 version will ... see: http://blogs.msdn.com/ukcrm/archive/2008/11/10/what-s-new-in-crm5.aspx
I have also inquired regarding this issue at the Dynamics CRM Forum
Unfortunately there is no transaction support for the current Dynamics CRM Web Services. This is quite dangerous, since our custom solution invoking several web services call to implement one holistic unit of work, and if one of the web service call encountered error during the execution, it will create data integrity issue
Regards
hadi teo

Resources