Using eclipselink in a three tier

Hi, I'm using eclipselink in a three tier architechture. Normally this is set up with just one database user having a connection pool. What I want to set up is that all client users log in and get their own connection, so that they use their own database user account. So I need somehow to create an entitymanager that does not use a connection from the connection pool, but creates a connection using the credentials the user logged in the application with.
Can someone give me a hint how to achieve that?
TIA,
Tom

Hi,
You can customize the session to use the username and password for logging to database.Below sample code uses sessioncustomizer to customize the user credentials for database login.
If you are using the JDeveloper for Toplink development.
Open the persistence.xml in flat editor and select the Topink customization tab and select the below class for Session customization.Whenever application is run the database login will be customized to the passed in username and password values.
import org.eclipse.persistence.config.SessionCustomizer;
import org.eclipse.persistence.sessions.Session;
public class SampleSessionCustomizer implements SessionCustomizer {
public SampleSessionCustomizer() {
super();
public void customize(Session session) throws Exception {
session.getLogin().setUserName(userName);
session.getLogin().setPassword(password);
Hope this helps.
Regards,
P.Vinay Kumar

Similar Messages

  • Three tier architecture questions

    Hello,
    My question is in regards to using Toplink in a three tier architecture situation. If I wish to send an object A which has a collection of Bs and B has a collection of C ( A nested object structure with two or more levels of indirection). Is the best solution to have the named query be part of a unit of work so that even if on the client side somebody unknowingly were to make the modification to one of the entity objects ( a POJO) the shared session cache would not be affected ?
    This is assuming the client side HTTP layer and the RMI/EJB layer are on different JVMs.
    Some of the other suggestions I have heard is to retrieve it from the shared session cache directly and if in case I need to modify one or more of the objects do a named query lookup on that object alone and then proceed to register that object in a unit of work and then commit the changes.
    Also the indirection would have to be utilised before the data objects are sent to the Servlet layer I presume ?(That is if I do a a.getAllOfBObjects() on the servlet side I would get a nullpointer exception unless all of B were already instatiated on the server side). Also when the objects are sent back to the server do I do a registerObject on all the ones that have changed and then do a deepMergeClone() before the uow.commit() ?
    Thanks,
    Aswin.

    Aswin,
    If your client is remote to the EJB tier then all persistent entities are detached through serialization. In this architecture you do not need to worry about reading and modifying the shared instance as it never the one being changed on the client (due to serialization).
    Yes, you do need to ensure that all required indirect relationships are instantiated on the server prior to returning them from the EJB call.
    Yes, you do need to merge the changes of the detached instance when returned to the server. I would also recommend first doing a read for the entity being merged (by primary key) on the new UnitOfWork prior to the merge. This will handle the case where you are merging into a different node of the cluster then where you read as well as allowing you to check for the case where the entity no longer exists in the database (if the read returns null then the merge will result in an INSERT and this may not be desired).
    Here is an example test case that does this:
        public void test() throws Exception {
            Employee detachedEmp = getDeatchedEmployee("Jill", "May");
            assertNotNull(detachedEmp);
            // Remove the first phone number
            PhoneNumber phone = detachedEmp.getPhoneNumber("Work");
            assertNotNull("Employee does not have a Work Phone Number",
                          detachedEmp.getPhoneNumber("Work"));
            detachedEmp.removePhoneNumber(phone);
            UnitOfWork uow = session.acquireUnitOfWork();
            Employee empWC = (Employee) uow.readObject(detachedEmp);
            if (empWC == null) { // Deleted
                throw new RuntimeException("Could not update deleted employee: " + detachedEmp);
            uow.deepMergeClone(detachedEmp);
            uow.commit();
         * Return a detached Employee found by provided first name and last name.
         * Its phone number relationship is instantiated.
        public Employee getDeatchedEmployee(String firstName, String lastName) {
            ReadObjectQuery roq = new ReadObjectQuery(Employee.class);
            ExpressionBuilder builder = roq.getExpressionBuilder();
            roq.setSelectionCriteria((builder.get("firstName").equal(firstName)).and(builder.get("lastName").equal(lastName)));
            Employee employee = (Employee)session.executeQuery(roq);
            employee.getPhoneNumbers().size();
            return (Employee)SerializationHelper.serialize(employee);
        }One other note: In these types of application optimistic locking is very important. You should also make sure that the locking field(s) are mapped into the object and not stored only in the TopLink cache. This will ensure the locking semantics are maintained across the detachment to the client and the merge back.
    Doug

  • Three tier architecture using oracle dev suite 10g & oracle database 9i

    hi ,
    I am trying to build a software which will manage the database of a hospital through usual form design .
    The tools I am using for these are
    (1) oracle server database 9i (2) oracle developer suite 10g (3) windows xp professional service pack 2 .
    I have designed the form modules in developer suite , created the tables in the database , connected those tables to the form modules using dml statements, now data can be inserted , updates and deleted through the form design . I have also deployed the forms using "run forms through web" and thereby other computers connected to the main computer through lan can also access the software using the web port address and the name of form to be used , these computers are not having oracle developer suite or oracle database installed , but they can access the software through the browser .
    In this scenario my question is that , is this a three tier architecture as oracle database is the first tier , oracle developer suite is the middle tier where I am puting all the bussiness logics and oc4j instance is used to connect the database and the dev suite , and for user interaction we have the browser as the third tier ?
    or this is a two tier architecture ? if this is a two tier architecture please let me know how can I implement a three tier architecture using oracle developer suite 10g and oracle server database 9i .
    Thanks a lot for showing ur interest to read this

    You need Oracle Application Server to deploy the forms when you go live.
    What you are currently using OC4J which came in the developer suite. It is used only for development purpose and can not have capacity to handle higher load.
    3 tier arch
    1. Thin Client :-> Browser
    2 Middle tier -> Oracle Appln Server /OC4j(in ur case)
    3 Database Tier -> Oracle Database
    Rajesh

  • How to Use Swing-ADF in a Three-Tier-Archiitecture

    I am currently avaluating Swing-ADF (11g) and I wonder how I can leverage it in a three-tier, rich-thin-client-environment. When I bind a control, normally I would do it directly to the database. As I want to have my business logic and database access on the middle-tier, how do I bind my controls to the middle-tier which in turn accesses the database. Does ADF support a mechanism to bind the Swing-Client to the middle-tier-data? Is the recommended way to go for webservices? Can Webservices easily bound to the ADF-controls? Is it the only way?
    best regards
    Stefan

    Stefan,
    It is a built-in feature of ADF Business Components to expose an application module as a stateful EJB session bean to support three-tier Swing-client access. It requires absolutely no effort from the developer, who can even easily switch between running/testing in 2-tier or 3-tier modes. Shay's answer is valid for the general case, but in the specific case of what the ADF tech stack can bring to bear to solve your problem, it can be completely simple to achieve (even requiring zero code, if you choose to leverage that feature of ADFBC).

  • Pessimistic locking in a three-tier architecture

    Hello,
    we use a three-tier architecture to edit data in a database (Oracle 10g) with a rich-client application and we want to use pessimistic locking.
    The client is communicating with a stateless bean on the application server (Jboss 4.2.3).
    This bean-facade has methods for reading, writing and locking records that are transferred to the client encapsulated in entity beans.
    The client controls the transactions as JPA-User-Transactions.
    The methods in the container managed bean have the transaction attribute REQUIRED.
    Before doing any modification on the client a method setLock() is called in the bean to lock the records in the database.
    The lock is implemented with query hints:
    Query query = em.createQuery("select e from Person e WHERE e.id = 252");
    query.setHint(QueryHints.PESSIMISTIC_LOCK, PessimisticLock.LockNoWait);
    So much for this theroy...
    Practically we can set a lock on a record in the database.
    But removing the lock is working when changing and committing the record only.
    The record remains locked if performing a rollback or a commit without any changes.
    Any idea what's missing in our implementation?
    Our approach should work - theoretically...
    Thanks in advance for any hint
    Best regards,
    Martin Kubitza
    T&P, Bochum/Germany

    Thank you for the hint on JPA - we are analyzing this now.
    Meanwhile we tried something "easier": Optimistic locking
    Optimistic locking works well with a version-column and the @VERSION annotation. But we get a problem with the @OptimisticLocking(type = OptimisticLockingType.ALL_COLUMNS annotation (see Optimistic Locking with OptimisticLockingType.ALL_COLUMNS
    We are using Eclipselink V1.1 and (now) a bean managed transaction type)
    Martin Kubitza
    T&P, Bochum/Germany

  • Reporting services in three tier SharePoint 2013 environment

    Hi,
    I am trying to integrate SQL Server 2012SP1 Reporting Services in a three tier SharePoint 2013 environment, but it seems it is not succesful.
    The setup is as following:
    SRV1: SQL Server with content, config,... and the Reporting Service databases.
    SRV2: SharePoint 2013 Application server & Central Administration
    SRV3: SharePoint Web Front with SharePoint sites
    All application pools are started with domain accounts on SRV2 & 3
    When opening the Central Administration site, the Reporting Services Service Application and its Proxy is created and configured. On SRV2 the Application exists in the application pool in IIS, but it does not appear in the SRV3. Should it be created manualluy?
    In Central Administration, when opening the site settings the Reporting Services section is created, but when opening the Site Settings for the root site the section shows variables:
    $Resources:ReportServerResources,ReportServerSiteSettingsGroupTitle;
    $Resources:ReportServerResources,ScheduleList;
    $Resources:ReportServerResources,SiteLevelSettings;
    $Resources:ReportServerResources,ManageSiteDataAlerts;
    I believe i need some help here.
    Thanks in advance.
    Best regards,
    J

    Hi J-S,
    Generally, the issue occurs if you are in the Windows Powershell instead of the SharePoint Management Shell or the Reporting Services - SharePoint mode feature is not installed. So, please double check you are using the SharePoint Management Shell or install
    the Add-in by installing the rssharepoint.msi instead. Here is the download link:
    http://www.microsoft.com/en-us/download/details.aspx?id=35583
    If it is not the issue, please install the Reporting Services - SharePoint mode from the SQL Server 2012 installation media.
    Reference:
    http://msdn.microsoft.com/en-us/library/ms144289.aspx#bkmk_cmdlets_not_recognized
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Three tier (mod pl/sql) vs. two tier (PL/SQL Gateway)

    I've been using 10g Database and 10g application server on separate servers for some time now.
    Going the two tier (11g) route has some attractions, but what are the disadvantages?
    The Oracle documentation I've seen says very little on making the decision, giving benefits as:
    Ease of configuration
    Included in the database
    No separate server installation
    - but no negatives.
    Does anyone have any real live experience of comparing the two options?
    I'm inclined to believe that three tier might have more tuning flexibility, better performance if each tier is on a different server. Maybe worse than two tier if on one server, assuming two tier eliminates communication overheads..
    Does pl/sql gateway have the caching ability of Apache/mod pl/sql - I assume not? - that could make a big difference.
    Any thoughts would be welcome...

    There are several key performance advantages of OHS over EPG. I'm working a lot with the EPG right now and pushing the XDB team to add several of these features (maybe in 11.2, possible backport, but don't count on it). I used recommendations from the yslow Firefox add-in to do some performance tuning. Here's there list of Best Practices:
    http://developer.yahoo.com/performance/rules.html
    - EPG does not add an "Expires" header. So, lets say you have 25 images in your page template, and none of them change. Each page view will still request those 25 images. They use etags, so you don't have to download the images, but your browser still makes the requests which is quite slow. From my testing, pages could be up to 4 times slower with the EPG with a pretty standard template. The XDB team is aware of this and working hard to resolve it.
    - EPG does not support gzip. This is another HUGE performance hit.
    Keep in mind you can't test any of those issue with debug mode in APEX, you really need to use a browser plugin such as Firebug + ySlow. The render speed from APEX's point of view will be the same, no matter what HTTP server you use.
    The other big on is mod_rewrite support. There is no way easily create friendly URLs for your apps. Another thing to consider is that a number of Identity Management systems, such as Oracle Access Manager (OAM) work by installing an Apache Module or in the case of IIS, some type of plugin (forget what they call it). There is no concept of this in EPG.
    IMHO, it's convenient for laptops, but I would never use it for production unless you needed some feature that it exposes, such as WebDav or FTP access to the XDB repository...
    Tyler

  • WPF How can I implement the INotifyPropertyChanged in a Three-tier architecture?

    I am a student and I am confused on using the INotifyPropertyChanged in a three-tier style of coding. Can you guys help me a bit with these?
    I have a solution named MetroAppProject. It is composed of four projects (I omitted the using clauses and references, just imagine they are there and are working fine):
    1. MetroApp.BluePrints - a class library composed of the classes in my sql db
    An example of my class
    namespace MetroApp.BluePrints
        public partial class Patient
            public long Id { get; set; }
            public string PatientNumber { get; set; }
            public string LastName { get; set; }
            public string FirstName { get; set; }
            public string MiddleName { get; set; }        
            public string AddressLine1 { get; set; }
            public Nullable<short> CityId { get; set; }
    public string CityName { get; set; }
            public Nullable<short> ProvinceId { get; set; }
    public string ProvinceName { get; set; }        
    Then the second project:
    2. MetroApp.DataAccess = a class library composed of methods that calls my sql procedures. I used the SqlHelper class which contains the connection strings and other stuffs.
    example class
    namespace MetroApp.DataAccess
        public class PatientDb
    public Patient Retrieve(PatientParams parameters)
                SqlCommand command = new SqlCommand();
                Patient singItem = new Patient();
                command.CommandText = "RetrievePatients";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.AddWithValue("@Id", parameters.Id).Direction = ParameterDirection.Input;
                DataTable dt = SqlHelper.GetData(command);
                if (dt.Rows.Count > 0)
                    DataRow row = dt.Rows[0];
                    singItem.Id = TDefaultValue.GetInt(row["Id"].ToString());
                    singItem.PatientNumber = TDefaultValue.GetString(row["PatientNumber"].ToString());
                    singItem.LastName = TDefaultValue.GetString(row["LastName"].ToString());
                    singItem.FirstName = TDefaultValue.GetString(row["FirstName"].ToString());
                    singItem.MiddleName = TDefaultValue.GetString(row["MiddleName"].ToString());
                    singItem.AddressLine1 = TDefaultValue.GetString(row["AddressLine1"].ToString());
                    singItem.CityId = TDefaultValue.GetShort(row["CityId"].ToString());
                    singItem.CityName = TDefaultValue.GetString(row["CityName"].ToString());
                    singItem.ProvinceId = TDefaultValue.GetShort(row["ProvinceId"].ToString());
                    singItem.ProvinceName = TDefaultValue.GetString(row["ProvinceName"].ToString());
                return singItem;
            public List<Patient> RetrieveMany(PatientParams parameters)
                var items = new List<Patient>();
                var command = new SqlCommand();
                command.CommandText = "RetrievePatients";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.AddWithValue("@Id", parameters.Id).Direction = ParameterDirection.Input;
                command.Parameters.AddWithValue("@PatientNumber", parameters.PatientNumber).Direction = ParameterDirection.Input;
                command.Parameters.AddWithValue("@LastName", parameters.LastName).Direction = ParameterDirection.Input;
                command.Parameters.AddWithValue("@FirstName", parameters.FirstName).Direction = ParameterDirection.Input;
                command.Parameters.AddWithValue("@MiddleName", parameters.MiddleName).Direction = ParameterDirection.Input;            
                command.Parameters.AddWithValue("@CityId", parameters.CityId).Direction = ParameterDirection.Input;
                command.Parameters.AddWithValue("@ProvinceId", parameters.ProvinceId).Direction = ParameterDirection.Input;
                DataTable dt = SqlHelper.GetData(command);
                foreach (DataRow row in dt.Rows)
                    var item = new Patient();
                    item.Id = TDefaultValue.GetLong(row["Id"].ToString());
                    item.PatientNumber = (row["PatientNumber"].ToString());
                    item.LastName = (row["LastName"].ToString());
                    item.FirstName = (row["FirstName"].ToString());
                    item.MiddleName = (row["MiddleName"].ToString());                
                    item.AddressLine1 = (row["AddressLine1"].ToString());
                    item.CityId = (short)row["CityId"].ToString();
                    item.CityName = (row["CityName"].ToString());
                    item.ProvinceId = (short)row["ProvinceId"].ToString();
                    item.ProvinceName = (row["ProvinceName"].ToString());
                    items.Add(item);
                return items;
            public bool Insert(Patient entity, int userId, ref bool doesExist)
                var command = new SqlCommand();
                try
                    command.CommandText = "AddPatient";
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@PatientNumber", entity.PatientNumber).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@LastName", entity.LastName).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@FirstName", entity.FirstName).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@MiddleName", entity.MiddleName).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@AddressLine1", entity.AddressLine1).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@CityId", entity.CityId).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@ProvinceId", entity.ProvinceId).Direction = ParameterDirection.Input;
    command.Parameters.AddWithValue("@Id", entity.Id).Direction = ParameterDirection.Input;
                    command.Parameters.Add("@DoesExist", SqlDbType.Bit).Direction = ParameterDirection.Output;
                    int result = SqlHelper.ExecuteNonQuery(command);
                    doesExist = (bool)(command.Parameters["@DoesExist"].Value);
                    entity.Id = (int)(command.Parameters["@Id"].Value);
                    if (result == 0 || doesExist)
                        return false;
                    return true;
                catch (Exception)
                    return false;
            public bool Update(Patient entity, int userId, ref bool doesExist)
                var command = new SqlCommand();
                try
                    command.CommandText = "EditPatient";
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@PatientNumber", entity.PatientNumber).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@LastName", entity.LastName).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@FirstName", entity.FirstName).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@MiddleName", entity.MiddleName).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@AddressLine1", entity.AddressLine1).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@CityId", entity.CityId).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@ProvinceId", entity.ProvinceId).Direction = ParameterDirection.Input;
    command.Parameters.AddWithValue("@Id", SqlDbType.Int).Direction = ParameterDirection.Output;
                    command.Parameters.Add("@DoesExist", SqlDbType.Bit).Direction = ParameterDirection.Output;
    doesExist = (bool)(command.Parameters["@DoesExist"].Value);
                    int result = SqlHelper.ExecuteNonQuery(command);
                    if (result == 0 || doesExist)
                        return false;
                    return true;
                catch (Exception)
                    return false;
    Then a business logic
    3. MetroApp.BusinessLogic = class libray for calling the methods from DataAccess
    namespace MetroApp.BusinessLogic
        public class PatientMgr
            #region Fields
            private readonly PatientDb _db;
            #endregion
            #region Properties
            public Patient Entity { get; set; }
            public List<Patient> EntityList { get; set; }
            public PatientParams Parameters { get; set; }
            #endregion
            #region Constructors
            public PatientMgr()
                _db = new PatientDb();
                Entity = new Patient();
                EntityList = new List<Patient>();
                Parameters = new PatientParams();
            #endregion
            #region Methods
    public Patient Retrieve(PatientParams parameters)
                return _db.Retrieve(parameters);
            public List<Patient> RetrieveMany(PatientParams parameters)
                return _db.RetrieveMany(parameters);
            public bool Insert(Patient entity, int userId, ref bool doesExist)
                return _db.Insert(entity, userId, ref doesExist);
            public bool Update(Patient entity, int userId, ref bool doesExist)
                return _db.Update(entity, userId, ref doesExist);
            #endregion
    Then the last one, the WPF GUI
    <UserControl x:Class="MetroDentProject.Pages.PatientDetailsPage"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                 xmlns:dims="clr-namespace:MetroAppProject.UserCons"
                 mc:Ignorable="d" 
                 d:DesignHeight="720" d:DesignWidth="1280">
        <Grid x:Name="MainGrid" >
            <Grid.RowDefinitions>
                <RowDefinition  Height="40"/>
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <GroupBox Grid.Column="0" Grid.Row="1" Grid.RowSpan="7" x:Name="DetailsGroupBox" Header="Patient Details" >
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <TextBlock Text="Id: " Grid.Column="1" Grid.Row="0" Visibility="Collapsed"/>
                    <TextBox x:Name="IdTextBox" Grid.Column="1" Grid.Row="1" Visibility="Collapsed"/>
                    <TextBlock x:Name="PatientNumberTextBlock" Text="Patient Number: " Grid.Column="0" Grid.Row="0" />
                    <TextBox x:Name="PatientNumberTextBox" Grid.Column="1" Grid.Row="0" IsReadOnly="True" IsReadOnlyCaretVisible="True"/>
                    <TextBlock Text="Last Name: " Grid.Column="0" Grid.Row="1" />
                    <TextBox x:Name="LastNameTextBox" Grid.Column="1" Grid.Row="1" />
                    <TextBlock Text="First Name: " Grid.Column="0" Grid.Row="2" />
                    <TextBox x:Name="FirstNameTextBox" Grid.Column="1" Grid.Row="2" />
                    <TextBlock Text="Middle Name: " Grid.Column="0" Grid.Row="3" />
                    <TextBox x:Name="MiddleNameTextBox" Grid.Column="1" Grid.Row="3" />
                </Grid>
            </GroupBox>
            <GroupBox x:Name="ContactDetailsGroupBox" Header="Contact Details" Grid.Column="1" Grid.Row="1" Grid.RowSpan="7">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <TextBlock Text="Address: " Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" />
                    <TextBlock Text="City: " Grid.Column="0" Grid.Row="2" />
                    <TextBlock Text="Province: " Grid.Column="0" Grid.Row="3"/>
                    <TextBox x:Name="AddressTextBox" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2"
                             TextWrapping="Wrap"
                             AcceptsReturn="True"
                             VerticalScrollBarVisibility="Auto"
                             />
                    <ComboBox x:Name="CitiesComboBox"  Grid.Column="1" Grid.Row="2"  />
                    <ComboBox x:Name="ProvincesComboBox"  Grid.Column="1" Grid.Row="3" />
                </Grid>
            </GroupBox>
            <dims:FunctionButtonsControl x:Name="FunctionButtonsCon" Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="2"
                                         ExecuteClick="FunctionButtonsCon_OnExecuteClick"
                                         UndoClick="FunctionButtonsCon_OnUndoClick"
                                         BackClick="FunctionButtonsCon_OnBackClick"
                                         DeleteClick="FunctionButtonsCon_OnDeleteClick"
                                         />
        </Grid>
    </UserControl>
    I apologize for the long post. As you can see, I don't use binding. Binding requires me to use INotifyPropertyChanged interface which I am not familiar. Can you at least make my project to implement the INotifypropertyChanged?
    Here is my sample code for the WPF page:
    public partial class PatientDetailsPage 
            readonly PatientMgr itemMgr = new PatientMgr();       
            public PatientParams CurrentPar = new PatientParams(); // for undoActionType _action = ActionType.Insert; // this is an enum from another project, ActionType.Insert, ActionType.Update
            public ActionType Action
                get { return _action; }
                set { _action = value; }
            public PatientDetailsPage()
                InitializeComponent();
                BindComboBoxes();
            #region Methods
            public void OnFragmentNavigation(FragmentNavigationEventArgs e)
            public void OnNavigatedFrom(NavigationEventArgs e)
            public void OnNavigatedTo(NavigationEventArgs e)
            {            Setup();
            public void OnNavigatingFrom(NavigatingCancelEventArgs e)
            public Patient GetPageEntity()
                Patient setEntity = new Patient();
                setEntity.Id = (long)IdTextBox.Text;
                setEntity.PatientNumber = PatientNumberTextBox.Text;
                setEntity.LastName = LastNameTextBox.Text;
                setEntity.FirstName = FirstNameTextBox.Text;
                setEntity.MiddleName = MiddleNameTextBox.Text;
                setEntity.AddressLine1 = AddressTextBox.Text;
                setEntity.CityId = (short)CitiesComboBox.SelectedValue);
                setEntity.ProvinceId = (short)ProvincesComboBox.SelectedValue;
                setEntity.StatusId = true;
                return setEntity;
            public void Setup()
                switch (Action)
                    case ActionType.Insert:
                        Clearer(); //clears all textboxes and set all comboboxes to default
                        this.PatientNumberTextBlock.Visibility = Visibility.Collapsed;
                        this.PatientNumberTextBox.Visibility = Visibility.Collapsed;
                        FunctionButtonsCon.ExecuteButton.Content = "Add";
                        FunctionButtonsCon.DeleteButton.IsEnabled = false;
                        FunctionButtonsCon.DeleteButton.Visibility = Visibility.Hidden;
                        break;
                    //**Setup Update
                    case ActionType.Update:CurrentPar.Id = (long)IdTextBox.Text;
                        LoadSingle(CurrentPar);
                        this.PatientNumberTextBlock.Visibility = Visibility.Visible;
                        this.PatientNumberTextBox.Visibility = Visibility.Visible;
                        FunctionButtonsCon.ExecuteButton.Content = "Save";
                        FunctionButtonsCon.DeleteButton.IsEnabled = true;
                        FunctionButtonsCon.DeleteButton.Visibility = Visibility.Visible;
                        break;                
                LastNameTextBox.CaretIndex = LastNameTextBox.Text.Length;
                IsVisibleChanged += AutoFocus;
            public void LoadSingle(PatientParams parameters)
                var entity = itemMgr.Retrieve(parameters); //calls the BusinessLogic
                IdTextBox.Text = (entity.Id);
                PatientNumberTextBox.Text = (entity.PatientNumber);
                LastNameTextBox.Text = (entity.LastName);
                FirstNameTextBox.Text = (entity.FirstName);
                MiddleNameTextBox.Text = (entity.MiddleName);
                AddressTextBox.Text = (entity.AddressLine1);
                CitiesComboBox.SelectedValue = (short)entity.CityId;
                ProvincesComboBox.SelectedValue = (short)entity.ProvinceId;
            public void Save(ActionType action, int userId)
                itemMgr.Entity = GetPageEntity();
                bool doesExist = false;
                switch (action)
                    case ActionType.Insert:
                        if (itemMgr.Insert((itemMgr.Entity), userId, ref doesExist))
                            System.Windows.Forms.MessageBox.Show("Successfully added a Patient!", "Patient Insertion");                  
                        else if (doesExist)
                            System.Windows.Forms.MessageBox.Show("Item already exists.", "Patient Insertion");
                        else
                            System.Windows.Forms.MessageBox.Show("Not all fields were filled in.", "Patient Insertion");
                        break;
                    case ActionType.Update:
                        if (itemMgr.Update(itemMgr.Entity, userId, ref doesExist))
                            System.Windows.Forms.MessageBox.Show("Successfully updated a Patient!", "Patient Modification");
                            itemMgr.Parameters.Id = itemMgr.Entity.Id;
                            Action = ActionType.Update;
                            Setup();
                        else if (doesExist)
                            System.Windows.Forms.MessageBox.Show("Item already exists.", "Patient Modification");
                        else
                            System.Windows.Forms.MessageBox.Show("Not all fields were filled in.", "Patient Modification");
                        break;                
            public void Clearer()
                IdTextBox.Clear();
                PatientNumberTextBox.Clear();
                LastNameTextBox.Clear();
                FirstNameTextBox.Clear();
                MiddleNameTextBox.Clear();
                CitiesComboBox.SelectedIndex = 0;
                ProvincesComboBox.SelectedIndex = 0;
                AddressTextBox.Clear();            
            public void BindComboBoxes()
                CitiesComboBox.ItemsSource = new BindingSource(CommonMgr.GetCitiesDropDown(), null);// the CommonMgr is a static class from another project. It works just fine
                CitiesComboBox.DisplayMemberPath = "Value";
                CitiesComboBox.SelectedValuePath = "Key";           
                ProvincesComboBox.ItemsSource = new BindingSource(CommonMgr.GetProvincesDropDown(), null);
                ProvincesComboBox.DisplayMemberPath = "Value";
                ProvincesComboBox.SelectedValuePath = "Key";
                CitiesComboBox.SelectedIndex = 0;
                ProvincesComboBox.SelectedIndex = 0;
            #endregion
            #region Events
            private void FunctionButtonsCon_OnExecuteClick(object sender, RoutedEventArgs e)
                Save(Action, SessionHelper.MyUser.Id); //SessionHelper.MyUser.Id
            private void FunctionButtonsCon_OnUndoClick(object sender, RoutedEventArgs e)
                if (Action == ActionType.Insert)
                    Clearer();
                    return;
            private void FunctionButtonsCon_OnBackClick(object sender, RoutedEventArgs e)
                Exiter();
            private void FunctionButtonsCon_OnDeleteClick(object sender, RoutedEventArgs e)
                var ans = System.Windows.Forms.MessageBox.Show("Are you sure you want to delete this entry?", "Patient Deletion", MessageBoxButtons.YesNo);
                if (!Equals(ans, System.Windows.Forms.DialogResult.Yes)) return;
                Action = ActionType.Delete;
                Save(Action, SessionHelper.MyUser.Id);
                Exiter();
            #endregion

    Hello Kokombads,
    I thought you are using MVVM from your title but it seems your project is just a simple WPF project. In that way, please check the following msdn article to know how to Implement Property Change Notification
    https://msdn.microsoft.com/en-us/library/ms743695(v=vs.110).aspx
    using System.ComponentModel;
    namespace SDKSample
    // This class implements INotifyPropertyChanged
    // to support one-way and two-way bindings
    // (such that the UI element updates when the source
    // has been changed dynamically)
    public class Person : INotifyPropertyChanged
    private string name;
    // Declare the event
    public event PropertyChangedEventHandler PropertyChanged;
    public Person()
    public Person(string value)
    this.name = value;
    public string PersonName
    get { return name; }
    set
    name = value;
    // Call OnPropertyChanged whenever the property is updated
    OnPropertyChanged("PersonName");
    // Create the OnPropertyChanged method to raise the event
    protected void OnPropertyChanged(string name)
    PropertyChangedEventHandler handler = PropertyChanged;
    if (handler != null)
    handler(this, new PropertyChangedEventArgs(name));
    It is not so complex, you only need to refer to the interface from here:
    https://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged(v=vs.110).aspx
    And understand that you have to do the following:
    For change notification to occur in a binding between a bound client and a data source, your bound type should either:
    Implement the INotifyPropertyChanged interface (preferred).
    Provide a change event for each property of the bound type
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Sharepoint 2013 Foundation three tier farm with two Webservers in NLB

    Heloo,
    I have been strugling with a problem the last htree days.
    I have instelled and configured a sharepoint 2013 three tier farm with Sharepoint 2013 Foundation and MS SQL 2014 Express. This is a Test Farm and all the servers are Windows 2012 R2.
    I have one SQL Server, one Application Server and two Webservers. The tow web servers are configured with Multicasting NLB. The NLB name is "sharepoint.ws.domain.net". The IP of the NLB is also in our DNS Zone.I have made a Web Application with
    the name "sharepoint.ws.domain.net" on port 80 (NLB name) and a Site collection with the same name.
    Now whene I am working on the Sharepoint Site I get very offen a login Window or I get the message "An error occurred while processing the request on the server. The status code returned from the server was: 0".
    The error "An error occurred while processing the request on the server. The status code returned from the server was: 0" comes when I try to create a sub Site (most with no Permissions inheritance)... but not allways. I also get  sometimes
    the same message when I upload files (MS Office documents and PDF files).
    The login Windows comes whene I am navigating throw the Sites... but also not allways.I go to the Site with an IE11 and the Site is also in the Intranet security sites.
    Can you help me on this one...
    Kind Regards
    Ioannis Kyriakidis

    With no hostname on the Web Application, you have to create Host-named Site Collections. So that complicates things a bit.
    As far as NLB setup, you create Web Applications the same way you would otherwise. NLB is simply installed on both Web Servers and placed into the NLB VIP (virtual IP). The DNS A record points at the VIP.
    Also set up your Windows NLB using Unicast instead of Multicast. If you have certain types of switches that block unicast ARP from multiple clients, e.g. Cisco, you may have to make an exception for them (e.g. http://www.cisco.com/c/en/us/support/docs/switches/catalyst-6500-series-switches/107995-microsoft-nlb.html).
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Three Tier Configuration

    Hi friends,
    I am planning to implement oracle three tier architecture and want to know -
    How the oracle three tier architecture should be configured on a network?
    As per my information :
    Database Tier : Oracle 9i server database on a machine
    Middle Tier : oracle 9i AS as middle tier on a machine
    Client Tier : what software should be installed on client tier?
    As middle tier need
    Pentium 300MHz,6GB hdd space,512 RAM
    What are the minimum requirement of client tier to run form and reports applications?

    1. Use 10g Application Server - You have to install the Enterprise version for forms & reports servers - you can choose to not configure the pieces you don't want to use as part of the setup though.
    2. Java plugin is more mature than the jinitiator. Java plugin works on more systems and is much quicker since its much newer than the 1.1.8 and 1.3.x version oracle provides - Sun or IBM jvm's work great.
    3. In most cases uses have an office application, email application or other tools running in conjunction to being logged into a forms/reports application. With the over head of multiple browsers, jvm, and other applications i wouldn't recommend anything else. With Pentium 4 systems fully loaded for business systems running 699.00 or less (dell/hp/gateway) i don't think client side computing power should be an issues - especially if you can afford the licensing costs of the application server to begin with :)
    In my experience give your "power" users (the ones running your business apps) the POWER they need to get the job done right and they will appreciate the new systems you implement rather than fear them. A PC upgrade is alot easier then months and months of headaches with people complaining about response times, load times, performance and application useability.

  • How to install oracle applicatons in a three tier architecture

    Hi,
    i want to install oracle apps in a three tier architecture?
    application tier -- middle tier
    database tier -- database tier
    Any steps or a meta link document
    Regards
    Sudharshan

    Hi,
    http://download.oracle.com/docs/cd/B34956_01/current/acrobat/120oaig.pdf
    Pages 2-10 and Pages 2-19 don't specify this ???
    They indicate only having to install with rapidwiz 1 time (as root user if appl/ora accounts setup) ??It is mentioned in Page 1-2
    Release 12 utilizes the conf_<SID>.txt file in certain situations, for example where the database has not yet been created. The configuration file is also employed in multi-node (distributed) installs, where you only need to enter the install information once, on one machine, and can then copy the configuration file to other machines as required.
    If you are installing in an environment where different machines are used to support the database and Applications tiers (as is typically the case), you would run Rapid Install on each machine in turn, starting with the database machine.
    Regards,
    Hussein

  • Question about three-tier architecture for MI

    Hi,
    my question is just for the right understanding. If we speak about three-tier architecture of MI is it right, that the following is meant:
    Client = Presentation Tier
    Middleware = Application Tier/Logic Tier/Business Logic Tier
    Backend = Data Tier
    Thank you and regards,
    Florian

    Hi Florian,
    ICF (Internet Communication Framework) is actually a framework provided by any WebAS. MI makes use of this to receive/send the data from/to the client. It is referred to as ABAP Sync Service in MI terminology. Data comes in the form of HTTP stream. A service is created to provide this functionality. It performs the same job as of the J2EE engine in the earlier versions. The advantage being that an intermediate component between the client & middleware is not necessary anymore, because ICF is part of the WebAS itself.
    You can have a look at this in the sicf transaction, provide the service name as MJC, under this u can see that there are 3 services which MI uses - mi_host, mi_service & mi_mds.
    You can set these parameters in the mobileengine.config file to make the client connect to ABAP Sync Service.
    MobileEngine.Sync.Gateway.Service=/sap/bc/MJC/mi_host
    MI.Sync.ProtocolVersion=251500
    I am in the process of writing a blog, please wait for it.
    Regards,
    Nameeta

  • Servlets in three tier Architecture

    Hi
    We plan to use a three tier architecture with
    Client --- Applet (JDK 1.2)
    Middle tier -- WebServer and servlets
    Database Server -- Oracle 8i
    Our application should have data entry for several (5 - 12 ) tabs each consisting of around 15 fields . A few Jtables will also be used .
    Arounf 5 to 10 validations or queries are required to be done with the database in the applet. Around 300 entries will be made by 12 different users in a day.
    Is it advisable to use the above architecture ?
    Is it required to use Enterprise JavaBeans ?
    Will the use of servlets bring down the performance?
    Overall is our architecture feasible for the requirement ?
    We will be greatfull to your suggestions
    Please also mail to [email protected]
    N.Suresh

    Hello,
    We plan to use a three tier architecture with
    Client --- Applet (JDK 1.2)
    Middle tier -- WebServer and servlets
    Database Server -- Oracle 8i
    Our application should have data entry for several (5 - 12 ) tabs each consisting of around 15 fields . A few Jtables will also >be used .
    Arounf 5 to 10 validations or queries are required to be done with the database in the applet. Around 300 entries will be made >by 12 different users in a day.Have you considered using Business Components for Java to develop your application? From what you have described about your application BC4J seems to be the ideal candidate.
    Is it advisable to use the above architecture ?I see not limitation with your architecture. The only thing to keep in mind is that you should use applets only if you absolutely need to. Overall development and maintenance is much easier if you are just using servlets and JSPs.
    Is it required to use Enterprise JavaBeans ?See below.
    Will the use of servlets bring down the performance? No.
    Overall is our architecture feasible for the requirement ?If you had not needed applets then I'd have recommended the following:
    Scenario #1
    Client --- Browser
    Presentation Server -- Standard WebServer(Apache,OAS etc) running Servlets, JSPs talking to BC4J classes available on the local classpath
    Database Server -- Any Oracle Database
    Simplicity and ease of maintenance are some of the benefits of the above model. The limitation in the above scenario is that you cannot have a thin remote client(Java application or applet).
    If you want a remote client then I'd recommend:
    Scenario #2
    Client --- Browser|Applet (if you know you have a small number of users then you can go for a client side Application too)
    Presentation Server -- Standard WebServer(Apache,OAS etc) running Servlets, JSPs
    Application Server -- Standard AppServer (VisiBroker|OAS|JServer) running BC4J components as EJB session beans or CORBA server objects
    Database Server -- Any Oracle Database
    In this scenario the servlets|JSPs will be going over IIOP to talk to the application server. On the client side, the BC4J framework ensures that the network traffic is minimized and also the client side Java application or applet is as thin as it can be.
    Whether you go with scenario#1 or scenario#2 the cool thing about using BC4J is that you have to write your business logic only once and then you can deploy it in multiple platforms(local,EJB,CORBA) and access it from different clients(JSP,Servlets,Java,XML...) without modifying your business logic.
    Hope this helps.
    Please let me know if you have any questions.
    Regards,
    Arun
    null

  • Three tier architecture

    Hi
    I am using a three tier architechure.
    Client - Visual Basic 5 Application.
    Middle Tier - Multi-threaded Server developped with java (jdk1.1.8)
    Database: oracle 7.3.4.4
    I am using jdbc 7.3.4
    300 to 400 users are connected daily to this application (it is used by a call center)
    from time to time and for no obvious reason the server is down and the users and unable to connect to the server (the connected users can no more process their requests). The server should be reinitialized in order to work again correctly.
    This is causing a big problem because the call center cant work for 15 - 20 minutes each time it happens
    somebody told me that using jdbc 8 with oracle 8 could solve my problem.
    does anyone have any idea about this?
    thx a lot

    Let me make a guess here: Your middle and data tier are in some verson of windows right?
    If it is let me ask how much memory is on each.
    We had a similar problem and it came down to the simple fact that the OS or other MS Apps were leaking resources and we had to cycle the servers every so often to keep them running. Oracle 8x will not fix the problem if you are having OS leaks we've ran Oracle 7x and 8x now and both have been very stable with moderate to heavy use even on windows.

  • Netweaver gateway in three tier landscape

    Hi experts,
    Can You please explain what are the best practices when using SAP Netweaver gateway central HUB deployment in three tier landscape. Is it sufficient/possible to use one gateway system for all (DEV, QAS PRD) systems, or there is a must that every backend system has its own dedicated gateway system?
    Thank You and best regards,
    Igor

    Hi Igor,
    I would not support having one gateway system for all three (not even two) landscapes.
    For each landscape, it is a standard to have their of set of systems. Rather, any kind of communication between cross landscape systems is usually strictly prohibited.
    Still, let us think on what might be the consequences.
    Each service will have three system aliases one each for each of Dev, QA and Prod.
    What if a production service by mistake starts pointing to a Dev's system alias and starts showing products from Dev landscape? disastrous for the company!!!
    If you are worried about having to maintain one extra system for Gateway you can consider 'Embedded Deployment', which I have seen many clients have adopted successfully. (be aware of limitations though)
    regards
    Krishna

Maybe you are looking for