Class data access

I wasn't sure if this is the right forum, but this is as close as I can find.
Is it possible to obtain the actual class bytes of a Class from the VM? In the ClassLoader class, the actual class definition takes place in native, and as far as I know that isn't open source yet.
Since I know a lot of people arent going to get this, when I call defineClass with a byte array in a ClassLoader, is it possible to obtain those bytes elsewhere (to verify them, send them over net, etc)?

I wasn't sure if this is the right forum, but this is
as close as I can find.
Is it possible to obtain the actual class bytes of a
Class from the VM? That would depend on the VM of course but probably not.
In the ClassLoader class, the
actual class definition takes place in native, and as
far as I know that isn't open source yet.
Open source?
You can get the Sun source code if you want to look at it.
However the internals at that level are unlikely to ever be part of the Java API.
Since I know a lot of people arent going to get this,
when I call defineClass with a byte array in a
ClassLoader, is it possible to obtain those bytes
elsewhere (to verify them, send them over net, etc)?If you are passing the array in then you can certainly keep a copy.
You can't get them back with the Java API. You might get them back with internal api calls but I doubt it.

Similar Messages

  • Urgent: how to really seperate business logic class from data access class

    Hello,
    I've this problem here on my hand and i really need help urgently. so please allow me to thank anyone who replies to this thread =)
    Before i go any futhur, let me present a scenario. this will help make my question clearer.
    "A user choose to view his account information"
    here, i've attempted to do the following. i've tried to seperate my application into 3 layers, the GUI layer, the business logic layer, and the data access layer.
    classically, the GUI layer only knows which object it should invoke, for example in the case above, the GUI would instantiate an Account object and prob the displayAcctInfo method of the Account object.
    here is how my Account class looks like:
    public class Account
    private acctNo;
    private userid;
    private password;
    private Customer acctOwner;
    the way this class is being modelled is that there is a handle to a customer object.
    that being the case, when i want to retrieve back account information, how do i go about retrieveing the information on the customer? should my data access class have knowledge on how the customer is being programmed? ie setName, getName, setAge, getAge all these methods etc? if not, how do i restore the state of the Customer object nested inside?
    is there a better way to archieve the solution to my problem above? i would appriciate it for any help rendered =)
    Yours sincerely,
    Javier

    public class AccountThat looks like a business layer object to me.
    In a large application the GUI probably shouldn't ever touch business objects. It makes requests to the business layer for specific information. For example you might have a class called CustomerAccountSummary - the data for that might come entirely from the Account object or it might come from Account and Customer.
    When the GUI requests information it receives it as a 'primitive' - which is a class that has no behaviour (methods), just data. This keeps the interface between the GUI and business layer simple and makes it easier to maintain.
    When using a primitive there are four operations: query, create, update and delete.
    For a query the gui sets only the attributes in the primitive that will be specifically queried for (or a specialized primitive can be created for this.) The result of a query is either a single primitive or a collection of primitives. Each primitive will have all the attributes defined.
    For a create all of the attributes are set. The gui calls a method and passes the primtive.
    For an update, usually all fields are defined although this can vary. The gui calls a method and passes the primitive.
    For a delete, only the 'key' fields are set (more can be but they are not used.) The gui calls a method and passes the primitive.
    Also keep in mind that a clean seperation is always an idealization. For example verify that duplicate records are not created is a business logic requirement (the database doesn't care.) However, it is much easier and more efficient to handle that rule in the database rather than in the business layer.

  • Confusion... Data Access Object and Collection Class

    Please help me...
    i have a Book class in the library system, so normally i would have a Collection class eg. BookCollection class which keeps an array/ arrayList of Book objects. In BookCollection class i have methods like
    "searchBook(BookID)" which would return me a Book object in the array.
    But now i'm confused with Data Access Object... In sequence diagrams there's a "Data Access class" which is used to retrieve data from and send data to a database. So, if i have the Data Access class, do i still need BookCollection class? Because BookCollection serves as a database also rite? ...

    I think you're in the right rail.
    The BookCollection class could be still usefull if you will need to manage search results with more than onne record (e.g.: search by author name).

  • Generic Data Access For All Class

    Hello
    I am doing one experiment on Data Access. In traditional system We have to write each Insert, Update, Delete code in data access for each table.
    My City Table Class:
    public class TbCitiesModel
    string _result;
    int _cityID;
    int _countryID;
    string _name;
    int _sortOrder;
    bool _enable;
    DateTime _createDate;
    string _countryName;
    public string result
    get { return _result; }
    set { _result = value; }
    public int cityID
    get { return _cityID; }
    set { _cityID = value; }
    public int countryID
    get { return _countryID; }
    set { _countryID = value; }
    public string name
    get { return _name; }
    set { _name = value; }
    public int sortOrder
    get { return _sortOrder; }
    set { _sortOrder = value; }
    public bool enable
    get { return _enable; }
    set { _enable = value; }
    public DateTime createDate
    get { return _createDate; }
    set { _createDate = value; }
    public string countryName
    get { return _countryName; }
    set { _countryName = value; }
    Traditional Code:
    public List<TbCitiesModel> DisplayCities()
    List<TbCitiesModel> lstCities = new List<TbCitiesModel>();
    using (SqlConnection connection = GetDatabaseConnection())
    using (SqlCommand command = new SqlCommand("STCitiesAll", connection))
    command.CommandType = CommandType.StoredProcedure;
    SqlDataReader reader = command.ExecuteReader();
    while (reader.Read())
    lstCities.Add(new TbCitiesModel());
    lstCities[lstCities.Count - 1].cityID = Convert.ToInt32(reader["cityID"]);
    lstCities[lstCities.Count - 1].countryID = Convert.ToInt32(reader["countryID"]);
    lstCities[lstCities.Count - 1].name = Convert.ToString(reader["name"]);
    lstCities[lstCities.Count - 1].sortOrder = Convert.ToInt32(reader["sortOrder"]);
    lstCities[lstCities.Count - 1].enable = Convert.ToBoolean(reader["enable"]);
    lstCities[lstCities.Count - 1].createDate = Convert.ToDateTime(reader["createDate"]);
    return lstCities;
    The above code is used to fetch all Cities in the table. But when There is another table e.g  "TBCountries" I have to write another method to get all countries. So each time almost same code but just table and parameters are changing.
    So decided to work on only one global Method to fetch data from Database.
    Generic Code:
    public List<T> DisplayCitiesT<T>(T TB, string spName)
    var categoryList = new List<T>();
    using (SqlConnection connection = GetDatabaseConnection())
    using (SqlCommand command = new SqlCommand(spName, connection))
    command.CommandType = CommandType.StoredProcedure;
    foreach (var prop in TB.GetType().GetProperties())
    string Key = prop.Name;
    string Value = Convert.ToString(prop.GetValue(TB, null));
    if (!string.IsNullOrEmpty(Value) && Value.Contains(DateTime.MinValue.ToShortDateString()) != true)
    command.Parameters.AddWithValue("@" + Key, prop.GetValue(TB, null));
    SqlDataReader reader = command.ExecuteReader();
    while (reader.Read())
    int i = 0;
    TB = Activator.CreateInstance<T>();
    int colCount = reader.FieldCount;
    foreach (var prop in TB.GetType().GetProperties())
    if (prop.Name != "result" && i <= (colCount - 1))
    prop.SetValue(TB, reader[prop.Name], null);
    i++;
    categoryList.Add(TB);
    return categoryList.ToList();
    Calling method:
    TbCitiesModel c = new TbCitiesModel();
    Program p = new Program();
    List<TbCitiesModel> lstCities = p.DisplayCitiesT<TbCitiesModel>(c,"STCitiesAll");
    foreach (TbCitiesModel item in lstCities)
    Console.WriteLine("ID: {0}, Name: {1}", item.cityID, item.name);
    Now Its working fine but I have tested with 10,00,000 Records in TBCities Table following are the result.
    1. The Traditional method took almost 58 - 59 -  58 - 59 - 59 seconds for 5 time
    2. The Generic Method is took 1.4 - 1.3 - 1.5 - 1.4 - 1.4  [minute.seconds]
    So by the results of test is generic method is probably slower in performance [because its have 3 foreach loops] but the data is very big almost 10,00,000 lakes records. So it might work good in lower records.
    1. So My question is can I used this method for real world applications ?? Or is there any performance optimization for this method?
    2. Also we can use this for the ASP.NET C# projects??
    Owner | Software Developer at NULLPLEX SOFTWARE SOLUTIONS http://nullplex.com

    Hi
    Mayur Lohite,
    Q1:It is not reasonable compared Generic Code with Traditional Code. The main issue not Generic.
    After take a look at your Generic Code.  Reflection code get slower in performance.
    TB = Activator.CreateInstance<T>();
    As Reflection is truly late bound approach to work with your types, the more Types you have for your single assembly the more slow you go on. Basically few people try to work everything based on Reflection. Using reflection unnecessarily will make your application
    very costly.
    Here is a good article about this issue, please take a look.
    Reflection is Slow or Fast? A Practical Demo
    Q2:Or is there any performance optimization for this method?
    The article presents some .NET techniques for using Reflection optimally and efficiently.
    optimizing object creation with reflection
    Note optimize
    reflection with Emit
    method.
    Best regards,
    Kristin
    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.
    Hello Kristin
    Please can you tell how I optimize reflection in my code.
    public List<T> DisplayCitiesT<T>(T TB, string spName)
    var categoryList = new List<T>();
    using (SqlConnection connection = GetDatabaseConnection())
    using (SqlCommand command = new SqlCommand(spName, connection))
    command.CommandType = CommandType.StoredProcedure;
    foreach (var prop in TB.GetType().GetProperties())
    string Key = prop.Name;
    string Value = Convert.ToString(prop.GetValue(TB, null));
    if (!string.IsNullOrEmpty(Value) && Value.Contains(DateTime.MinValue.ToShortDateString()) != true)
    command.Parameters.AddWithValue("@" + Key, prop.GetValue(TB, null));
    SqlDataReader reader = command.ExecuteReader();
    while (reader.Read())
    int i = 0;
    TB = Activator.CreateInstance<T>();
    int colCount = reader.FieldCount;
    foreach (var prop in TB.GetType().GetProperties())
    if (prop.Name != "result" && i <= (colCount - 1))
    prop.SetValue(TB, reader[prop.Name], null);
    i++;
    categoryList.Add(TB);
    return categoryList.ToList();
    Thank you.
    Owner | Software Developer at NULLPLEX SOFTWARE SOLUTIONS http://nullplex.com

  • Data Access Class Reading a Text File????

    Hi,
    I have created a data access class... and for one of my constructors.. I need to go a text file and get the information : dsn name, username, and password from the file and bring it into the construtor... does anyone know how to do that??
    Thx
    Rich
    Here is my constructor:
    public DataAccess() {
    }

    Define a PropertyManager class where you specify the file and read the parameters? I have a sample I will have searc through my archive.
    Will post if after some time.
    Hope I gave a small spark to ignite.
    Cheers.
    Sekar.

  • Parent class private data accessable in Child class?

    Hi!
    I thought that this would be obvious, but my search foo fails me.  Hopefully someone would be kind enough to answer my newbie LVOOP question.
    I have a a parrent class.  This parrent class contains a cluster of class private data.  I setup all the accessor methods to this data.  I create a child class that has functions that need to access data stored in its parrent class.  Its inheritence is set, but when I try to unbundle the class data all I can seem to get to is what is setup in the child class' data cluster.
    I've watched a video and it looked like the data cluster magically appeared and was accessable through the children methods.  What am I missing?
    Thanks for input!
    -nic
    Solved!
    Go to Solution.

    Nickerbocker wrote:
    Well, that makes sense.
    One other quick question.  Is the procedure, New->"VI for Override..." from the context menu of my child class the only way to create a method that overrides the parents method?  Where is the property that defines this newly created VI as overriding my parent's VI?  Can I simply create a VI that is named the same and it have the same effect?
    That is the only method I use but I believe if you get all of your icon patterns and terminal marking as dynamic and all of the other rules, you should be able to do the same thing by hand (I base this guess on the fact I messed with those things and broke my ever-rides).
    The only thing I think has to be done from the project (scripting aside) is to set-up the inheritance.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Mathscript node access to class data

    I am trying to implement some code which I developed in Matlab in Labview. The code uses functions from the Control and Optimization toolboxes, and looks like it will port easily to Mathscript. I need to parameterize a state-space model of several drugs from several parameter (age, height,weight, gender). I can see how to create an lvclass Patient with a control which uses these four parameters in the private data. I'd like to be able to duplicate the Matlab-style syntax of Patient.Age, etc, by just wiring the Patient object to a Mathscript node.  There doesn't seem to be a way to do this without unbundling first. This seems inelegant, as it requires me to hard-code the names of the private data fields in the mathscript node interface. Is there a simple way to define lvclass data in a class VI's mathscript node?
    Matlab 2008a, Labview 8.6, MacPro OSX 10.5. 

    Hello,
    The MathScript syntactical element you are referring to is a structure.  Unfortunately, we do not have support for structures or cell arrays in MathScript at this time.  It is a limitation we are aware of and investigating for a future release.    You have discovered the workaround.  You will need to unbundle your class data and create separate variables for each member variable in the MathScript node.
    Grant M.
    Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments

  • ITunes 10.5.3, Unable to Load Class Data from Sync Services, Crashes Repeatedly

    Ever since iTunes 10.5.3 on my Windows 7 x64 box, I've been having serious problems keeping iTunes running:
    1)  Any time I connect my iPhone or iPad, or any time they attempt to sync over WiFi, I get the 'Unable to load class data from sync services' error.  It's worth mention that the iPhone or iPad do actually then proceed to sync correctly, and all media / data is synchronized successfully, as far as I've been able to tell.  I've reset sync history, restored the iPhone and iPad, manually moved the SyncServices directory, set both the iPhone and iPad up as new, completely uninstalled iTunes and the mobile device software, re-installed, and *nothing* I do fixes this issue or even seems to impact it.  Uninstalling iTunes 10.5.3 and reinstalling iTunes 10.5.2 resolves this error.
    2)  iTunes 10.5.3 has serious crashing problems on my machine, though I've searched through forums and found a lot of other people with the problem.  In my case, sporadically as iTunes access the iTunes store (for example, I can always make it happen by subscribing to the Diggnation podcast and telling it to refresh the podcast), I get a full application crash which generates the following event in the event log:
    Faulting application name: iTunes.exe, version: 10.5.3.3, time stamp: 0x4f14cc3d
    Faulting module name: KERNELBASE.dll, version: 6.1.7601.17651, time stamp: 0x4e211319
    Exception code: 0x80000003
    Fault offset: 0x0001280c
    Faulting process id: 0x564
    Faulting application start time: 0x01cce78789dc009a
    Faulting application path: D:\Program Files (x86)\iTunes\iTunes.exe
    Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
    Report Id: ecc77400-537a-11e1-b809-00248c196007
    Again, uninstalling iTunes 10.5.3 and re-installing iTunes 10.5.2 fixes this issue as well, but I really shouldn't have to do that.  Is there any actual solution to these problems other than dowgrading to an older version?
    Yes, I'm running current malware protection (and my system is clean) and yes, I've already checked any other obvious culprits to make sure I don't just have a corrupt library or file somewhere that's causing it.  My Windows 7 install is completely up to date from a Windows Update perspective and also from a driver perspective (even including the motherboard and chipset drivers).  I made sure to do a system file integrity check (sfc /scannow) and it confirmed my install of Windows isn't suspect, but beyond all that I was able to reproduce these failures on a completely separate machine running Windows 7 x64, without any of my media library or data on it -- iTunes 10.5.3 just seems to be bad news on Windows 7 x64 for me, even though I know there are definitely people are using it successfully.  I don't get any other application crashes for any other applications, and I've never had an issue like this with any previous version of iTunes...
    Last but not least, in case it matters, I'm running iOS 5.0.1 on both the iPhone4 and the iPad2.  The iPhone4 is the GSM AT&T model and the iPad2 is the CDMA Verizon model.

    OK, I've given up.  Uninstalled iTunes 10.5.3 permanently.  It's a shame, 10.5.2 works perfectly but 10.5.3 is a complete and total cluster for me.
    Anyone with the same problems who hasn't done this already, just uninstall iTunes and the Apple Mobile Device Service in your Add/Remove Programs, then re-install iTunes 10.5.2.  You won't lose your library or any settings or apps, it will just go back to working again.
    I wish Apple would acknowledge this so that I'd at least know it would be fixed in the future.

  • Failed to open the console and System Center Data Access Service wont start - SCOM 2012

    Log Name: Operations Manager
    Source: Data AccessLayer
    Event ID: 33333
    Data Access Layer rejected retry on SqlError:
     Request: ManagementGroupInfo
     Class: 16
     Number: 208
     Message: Invalid object name 'dbo.__MOMManagementGroupInfo__'.
    =============================================================
    Log Name: Operations Manager
    Source: OpsMgr SDK Service
    Event ID: 26380
    The System Center Data Access service failed due to an unhandled exception.  
    The service will attempt to restart.
    Exception:
    Microsoft.EnterpriseManagement.Common.SdkServiceNotInitializedException: The Data Access service has not yet initialized. Please try again.
       at Microsoft.EnterpriseManagement.ServiceDataLayer.DispatcherService.get_Container()
       at Microsoft.EnterpriseManagement.Mom.Sdk.Service.SdkSubService.SdkChannel.Start()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)
    =============================================================
    Failed to connect to server ' xxxxx'
    Date: 16/09/2013 20:36:16
    Application: Operations Manager
    Application Version: 7.0.8560.0
    Severity: Error
    Message: Failed to connect to server 'xxxxxx'
    Microsoft.EnterpriseManagement.Common.ServiceNotRunningException: The Data Access service is either not running or not yet initialized. Check the event log for more information. ---> System.ServiceModel.EndpointNotFoundException: Could not connect to net.tcp://xxxxx:5724/DispatcherService.
    The connection attempt lasted for a time span of 00:00:02.0020300. TCP error code 10061: No connection could be made because the target machine actively refused it xxx.xxx.xxx.xxx:5724.  ---> System.Net.Sockets.SocketException: No connection could
    be made because the target machine actively refused it xxx.xxx.xxx.xxx:5724
       at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
       at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
       --- End of inner exception stack trace ---
    Server stack trace:
       at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
       at System.ServiceModel.Channels.BufferedConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
       at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
       at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
       at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.EnterpriseManagement.Common.Internal.IDispatcherService.Connect(SdkClientConnectionOptions connectionOptions)
       at Microsoft.EnterpriseManagement.Common.Internal.SdkDataLayerProxyCore.Initialize(EnterpriseManagementConnectionSettings connectionSettings, SdkChannelObject`1 channelObjectDispatcherService)
       at Microsoft.EnterpriseManagement.Common.Internal.SdkDataLayerProxyCore.CreateEndpoint[T](EnterpriseManagementConnectionSettings connectionSettings, SdkChannelObject`1 channelObjectDispatcherService)
       --- End of inner exception stack trace ---
       at Microsoft.EnterpriseManagement.Common.Internal.ExceptionHandlers.HandleChannelExceptions(Exception ex)
       at Microsoft.EnterpriseManagement.Common.Internal.SdkDataLayerProxyCore.CreateEndpoint[T](EnterpriseManagementConnectionSettings connectionSettings, SdkChannelObject`1 channelObjectDispatcherService)
       at Microsoft.EnterpriseManagement.Common.Internal.SdkDataLayerProxyCore.ConstructEnterpriseManagementGroupInternal[T,P](EnterpriseManagementConnectionSettings connectionSettings, ClientDataAccessCore clientCallback)
       at Microsoft.EnterpriseManagement.Common.Internal.SdkDataLayerProxyCore.RetrieveEnterpriseManagementGroupInternal[T,P](EnterpriseManagementConnectionSettings connectionSettings, ClientDataAccessCore callbackDispatcherService)
       at Microsoft.EnterpriseManagement.Common.Internal.SdkDataLayerProxyCore.Connect[T,P](EnterpriseManagementConnectionSettings connectionSettings, ClientDataAccessCore callbackDispatcherService)
       at Microsoft.EnterpriseManagement.ManagementGroup.InternalInitialize(EnterpriseManagementConnectionSettings connectionSettings, ManagementGroupInternal internals)
       at Microsoft.EnterpriseManagement.Mom.Internal.UI.Common.ManagementGroupSessionManager.Connect(String server)
       at Microsoft.EnterpriseManagement.Monitoring.Console.Internal.ConsoleWindowBase.TryConnectToManagementGroupJob(Object sender, ConsoleJobEventArgs args)
    System.ServiceModel.EndpointNotFoundException: Could not connect to net.tcp://xxxxx:5724/DispatcherService. The connection attempt lasted for a time span of 00:00:02.0020300. TCP error code 10061: No connection could be made because the target machine actively
    refused it xxx.xxx.xxx.xxx:5724.  ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it xxx.xxx.xxx.xxx:5724
       at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
       at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
       --- End of inner exception stack trace ---
    Server stack trace:
       at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
       at System.ServiceModel.Channels.BufferedConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
       at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
       at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
       at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.EnterpriseManagement.Common.Internal.IDispatcherService.Connect(SdkClientConnectionOptions connectionOptions)
       at Microsoft.EnterpriseManagement.Common.Internal.SdkDataLayerProxyCore.Initialize(EnterpriseManagementConnectionSettings connectionSettings, SdkChannelObject`1 channelObjectDispatcherService)
       at Microsoft.EnterpriseManagement.Common.Internal.SdkDataLayerProxyCore.CreateEndpoint[T](EnterpriseManagementConnectionSettings connectionSettings, SdkChannelObject`1 channelObjectDispatcherService)
    System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it xxx.xxx.xxx.xxx:5724
       at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
       at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
    =============================================================
    Log Name: Operations Manager
    Source: OpsMgr Root Connector
    Event ID: 28001
    The Root connector received an exception from the Config Service on StateSyncRequest:
    System.Runtime.Remoting.RemotingException: Failed to connect to an IPC Port: The system cannot find the file specified.
    Server stack trace:
       at System.Runtime.Remoting.Channels.Ipc.IpcPort.Connect(String portName, Boolean secure, TokenImpersonationLevel impersonationLevel, Int32 timeout)
       at System.Runtime.Remoting.Channels.Ipc.ConnectionCache.GetConnection(String portName, Boolean secure, TokenImpersonationLevel level, Int32 timeout)
       at System.Runtime.Remoting.Channels.Ipc.IpcClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
       at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.EnterpriseManagement.Mom.Internal.IConfigService.OnStateSyncRequest(Guid source, UInt64 messageIdentifier, String cookie)
       at Microsoft.Mom.Connectors.Root.RootConnector.OnStateSyncRequest(Guid source, UInt64 messageIdentifier, String cookie)
    ================================================================
    Log Name: Operations Manager
    Source: OpsMgr Management Configuration
    Event ID: 29105
     The management group is not yet fully upgraded. OpsMgr Management Configuration Service will idle until upgrade is completed.
     Operations Manager database version: 1.0.0.0
     Minimum required version: 7.0.0.0

    Yes, i change the credentials, but doesnt work.
    Yes, i put the events in the
    main question!
    Events Logs:
    =======================================================
    Log Name: Operations Manager
    Source: Data AccessLayer
    Event ID: 33333
    Data Access Layer rejected retry on SqlError:
     Request: ManagementGroupInfo
     Class: 16
     Number: 208
     Message: Invalid object name 'dbo.__MOMManagementGroupInfo__'.
    =======================================================
    Log Name: Operations Manager
    Source: OpsMgr SDK Service
    Event ID: 26380
    The System Center Data Access service failed due to an unhandled exception.  
    The service will attempt to restart.
    Exception:
    Microsoft.EnterpriseManagement.Common.SdkServiceNotInitializedException: The Data Access service has not yet initialized. Please try again.
       at Microsoft.EnterpriseManagement.ServiceDataLayer.DispatcherService.get_Container()
       at Microsoft.EnterpriseManagement.Mom.Sdk.Service.SdkSubService.SdkChannel.Start()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)
    =======================================================
    Log Name: Operations Manager
    Source: OpsMgr Root Connector
    Event ID: 28001
    The Root connector received an exception from the Config Service on StateSyncRequest:
    System.Runtime.Remoting.RemotingException: Failed to connect to an IPC Port: The system cannot find the file specified.
    Server stack trace:
       at System.Runtime.Remoting.Channels.Ipc.IpcPort.Connect(String portName, Boolean secure, TokenImpersonationLevel impersonationLevel, Int32 timeout)
       at System.Runtime.Remoting.Channels.Ipc.ConnectionCache.GetConnection(String portName, Boolean secure, TokenImpersonationLevel level, Int32 timeout)
       at System.Runtime.Remoting.Channels.Ipc.IpcClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
       at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.EnterpriseManagement.Mom.Internal.IConfigService.OnStateSyncRequest(Guid source, UInt64 messageIdentifier, String cookie)
       at Microsoft.Mom.Connectors.Root.RootConnector.OnStateSyncRequest(Guid source, UInt64 messageIdentifier, String cookie)
    =======================================================
    Log Name: Operations Manager
    Source: OpsMgr Management Configuration
    Event ID: 29105
     The management group is not yet fully upgraded. OpsMgr Management Configuration Service will idle until upgrade is completed.
     Operations Manager database version: 1.0.0.0
     Minimum required version: 7.0.0.0

  • Database access code in objects constructor, or in data access object

    Given an object that is stored in a database, is it better to have the database access code in a constructor method, or a data access layer object? E.g. I have a Person class
    public class Person{
    int Id;
    String name;
    int age;
    }When I want to read a person's details from the database, I could use a constructor something like this:
    public Person(int id){
    Connection con = getDatabaseConnection();
    ResultSet rs = con.createStatement().executeQuery("Select name, age from person where person_id = " + id);
    rs.next();
    this.name = rs.getString(1);
    this.age=rs.getInt(2);
    }Or I could use a method in a data access object :
    public Person getPerson(int id){
    Person p = new Person();
    Connection con = getDatabaseConnection();
    ResultSet rs = con.createStatement().executeQuery("Select name, age from person where person_id = " + id);
    rs.next();
    p.setName(rs.getString(1));
    p.setAge(rs.getInt(2));
    return p;
    }It seems to me that the constructor approach has two advantages
    (1) the SQL code is kept in the relevant class (so if I want to add a field to Person, I only have to make changes to the Person class)
    (2) I don't have to have a setter method for each field
    Is one or other of these ways generally recognized as 'best practise'?

    malcolmmc wrote:
    But then, on the other hand, everytime a Person gains a new field that's two places you have to change it. if the persistence interface is written in terms of the object and uses ORM, I don't have to touch the implementation. all i have to do is update the object, the database, and the mapping - just like you and your home brew ORM.
    besides, so what? i'd fear the resource leak, bad layering, more difficult testing more.
    Actually lately I've used annotations to label setters with database field names and run a simple home brew ORM to convert rows into objects even when not using a more complex persistence manager.home brew ORM? why is that necessary when you can choose from hibernate, ibatis, jdo, jpa, etc.? that's just nuts.
    %

  • Class-data versus data and methods versus class-methods in OO ABAP

    Hi
    I was going thorugh following OO ABAP code.
    CLASS vessel DEFINITION.
      PUBLIC SECTION.
        METHODS: constructor,
                 drive IMPORTING speed_up TYPE i,
                 get_id RETURNING value(id) TYPE i.
        CLASS-METHODS: start,
                       objects,
                       inheritance,
                       interfaces,
                       events.
      PROTECTED SECTION.
        DATA: speed TYPE i,
              max_speed TYPE i VALUE 100.
      PRIVATE SECTION.
        CLASS-DATA object_count TYPE i.
        DATA id TYPE i.
    ENDCLASS.
    Whats is difference between methods and class-methods ?
    What is the difference between data and class-data ?

    Hi Rajesh,
    There are two types of componenets in a class
    1)Static components
    2) Instance components
    Instance components exist for every instance of the class, while static exist only once for any number of instances of the class.
    Components of the class are methods, attributes, events etc.
    static attributes are represented by CLASS-DATA and instance attributes are represented by DATA.
    static methods hence are done by CLASS-METHODS and can access only static attributes.
    Instance methods are done by METHODS and can access any attribute.
    For eg: supposing that in a class, there is a static attribute. Suppose after one instance is created, we are setting this static attribute value as 10. Now we are creating another instance of the same class. Now when you try to display the value of this attribute, it will be 10.ie. it needs to be initialized once and can be shared between instances.
    Just go through this document..You will get nice info from this.
    http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    If you want to go deeper, like object persistence and all, just refer this document.
    http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    Regards,
    SP.

  • Cannot reslove symbol class Date

    I am trying to get a clock to show the time in my program. However, when I try to compile the program a "cannot resolve symbol class Date" error appears. I can't figure out where the problem in my program is. Here is my source code. I would appreciate any help.
    import javax.swing.*;
    import java.io.*;
    import java.lang.*;
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    //import java.util.*;
    import java.math.*;
    public class store
    public static void main(String[] args)
    String dataInput;
         dataInput = JOptionPane.showInputDialog(null, "Input item data: ");
    JOptionPane.showMessageDialog(null, "" + dataInput);
    EasyReader console = new EasyReader();
    int i, j, k, inum, icom, min, nswaps; inum = 0; boolean swap = false;
    double num[] = new double[100]; double dsum, T;
         do
         System.out.println(); System.out.println("Command Menu"); System.out.println();
         System.out.println("1 = Display the data");
    System.out.println("2 = Bubble Sort the numbers");
    System.out.println("3 = Selection Sort the numbers");
    System.out.println("4 = Insertion Sort the numbers");
    System.out.println("5 = Binary Search for a number");
    System.out.println("0 = Exit the program"); System.out.println();
    System.out.print("Enter Command - ");
    icom = console.readInt(); System.out.println();
    switch (icom)
    case 1: // Display the data
                   Display(inum, num);
                   break;
    case 2: // Bubble sort
                   nswaps = 0;
                   for (i = 0; i < (inum-1); i++ )
              for (j = (i+1); j < inum; j++)
                        if (num[i] > num[j])
                                  T = num;
                             num[i] = num[j];
                             num[j] = T;
                             nswaps++;
                   System.out.println("The number of swaps was - " + nswaps);
                   Display(inum, num);
                   break;
    case 3: // Selection sort
                   nswaps = 0;
                   for (i = 0; i < inum - 1; i++) {
              min = i; swap = false;
    for (j = i + 1; j < inum; j++)
         if (num[j] < num[min]) { min = j; swap = true; }
    if (swap) {T = num[min];
              num[min] = num[i];
                        num[i] = T;
                        nswaps++;}
                   System.out.println("The number of swaps was - " + nswaps);
                   Display(inum, num);
                   break;          
    case 4: // Selection sort
                   nswaps = 0;
                   for (i = 1; i < inum; i++)
                   j = i; T = num[i];
                        while ((j > 0) && (T < num[j-1]))
              num[j] = num[j-1]; j--; nswaps++;
                   num[j] = T; nswaps++;
                   System.out.println("The number of swaps was - " + nswaps);
                   Display(inum, num);
                   break;
    case 5: // Binary Search
                   System.out.println("Your numbers will be sorted first");
                   System.out.println();
                   for (i = 1; i < inum; i++)
                   j = i; T = num[i];
                        while ((j > 0) && (T < num[j-1]))
              num[j] = num[j-1]; j--;
                   num[j] = T;
                   System.out.print("Enter the number to locate - ");
                   T = console.readDouble(); nswaps = 0; System.out.println();
                   int left = 0, right = inum, middle; k = -1;
                   while (left <= right)
                        middle = (left + right) / 2;
                        if (T > num[middle]) {left = middle + 1; nswaps++;}
                        else if (T < num[middle]) {right = middle - 1; nswaps++;}
                        else { k = middle; break; }
                   if (k == -1) System.out.println("Your number was not located in the array");
                   else System.out.println("Your number " + T + " is in position " + (k+1));
                   System.out.println();
                   System.out.println(nswaps + " comparisons were needed to search for your number");     
                   Display(inum, num);
                   break;
         } while (icom != 0);
         public static void Display(int inum, double num[])
              {     int k;
                   System.out.println();
                   System.out.println("");
                   System.out.println();
              for (k = 0; k < inum; k++)
              System.out.println((k+1) + " - " + num[k]);
         return;
    class Clock extends Thread
         //A Canvas that will display the current time on the calculator
         Canvas Time;
         //A Date object that will access the current time
         private Date now;
         //A string to hold the current time
         private String currentTime;
         //The constructor for Clock, accepting a Label as an argument
         public Clock(Canvas _Time)
              Time = Time;          //Time is passed by reference, so Time
                                       //now refers to the same Canvas
              start();               //start this thread
         //The overriden run method of this thread
         public void run()
              //while this thread exists
              while (true)
                   try
                        draw_clock();          //calls the draw_clock method
                        sleep(1000);          //puts this thread to sleep for one
                                                 //second
                   //catches an InterruptedException that the sleep() method might throw
                   catch (InterruptedException e) { suspend(); }
                   //catches a NullPointerException and suspends the thread if one occurs
                   catch (NullPointerException e) { suspend(); }
         //A method to draw the current time onto the Time Canvas on the applet
         public void draw_clock()
              try
                   //Obtains the Graphics object from the Canvas Time so that it can
                   //be manipulated directly
                   Graphics g = Time.getGraphics();
                   g.setColor(Color.gray);          //sets the color of the Graphics object
                                                      //to gray for the rectangle background
                   g.fillRect(0,0,165,25);          //fills the Canvas area with a rectangle
                                                      //starting at 0,0 coordinates of the Canvas
                                                      //and extending to the length and width
                   g.setColor(Color.orange);     //sets the color of the Graphics object
                                                      //to orange for the text color
                   get_the_time();                    //calls the get_the_time() method
                   //calls the drawString method of the Graphics object g, which will
                   //draw a string to the screen
                   //Accepts a string and two integers to represent the coordinates
                   g.drawString("Current Time - " + currentTime, 0, 17);          
              //catches a NullPointerException and suspends the thread if one occurs
              catch (NullPointerException e) { suspend(); }
         //A method to obtain the current time, accurate to the second
         public void get_the_time()
              //creates a new Date object for "now" every time this is called
              now = new Date( );
              //integers to hold the hours, minutes and seconds of the current time
              int a = now.getHours();
              int b = now.getMinutes();
              int c = now.getSeconds();
              if (a == 0) a = 12;          //if hours are zero, set them to twelve
              if (a > 12) a = a -12;     //if hours are greater than twelve, make a      
                                            //conversion to civilian time, as opposed to
                                            //24-hour time
              if ( a < 10)               //if hours are less than 10
                   //sets the currentTime string to 0, appends a's value and a
                   //colon
                   currentTime = "0" + a + ":" ;
              else
                   //otherwise set currentTime string to "a", append a colon
                   currentTime = a +":";               
              if (b < 10)                    //if minutes are less than ten
                   //append a zero to string currentTime, then append "b" and a colon
                   currentTime = currentTime + "0" + b + ":" ;
              else
                   //otherwise append "b" and a colon to currentTime string
                   currentTime = currentTime + b + ":" ;
              if (c < 10)                    //if seconds are less than ten
                   //append a zero to string currentTime, then append "c" and a colon
                   currentTime = currentTime + "0" + c ;
              else     
                   //otherwise append "c" to currentTime string
                   currentTime = currentTime + c;
    }          //end of the Clock class

    Wow.
    1) Please in future use the code tags to format code you post so that it doesn't think you have italics in your code and render it largely1 unreadable. Read this
    http://forum.java.sun.com/help.jspa?sec=formatting
    2) You commented out the import of java.util which is the problem you are complaining about.
    3) Are you planning to stick all the code you ever write into the one source file? Why is all this stuff rammed together. Yoinks.

  • Data Access Layer In BPM

    Hi,
    I am using WLPI. I need to define the data access layer. As workflows deal in
    XML and for JDBC calls I need value objects. I have few questions:
    Is there any proffered way of communication between BPM and database?
    Does BEA/Sun/BPM Users recommend entity beans for data access thru BPM?
    Do I have to write XML to value object and vice versa logic for each type of communication?
    Please recommend a standard approach.
    Thanks,
    Parag

    My questions are:
    Is it proper to use AI Adaptors for normal database storage? and is there any
    way to store the XML into its db representation? I was thinking of calling business
    operation from BPM, passing the xml and parsing it in session bean and make jdbc
    calls in ejb. Looks like a lot of effort. Hence I am curious to know other solutions
    Thanks,
    Parag
    "Dharnidhar Vemuri" <[email protected]> wrote:
    Hi,
    Ways that I can think of are
    - using Application Integration, specifically views (it also
    uses
    EJB)
    - EJB classes
    - a java class
    I didn't get u what u meant by XML to value object. Can u be in more
    detail.
    Thanks
    Dhar
    "Parag" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    I am using WLPI. I need to define the data access layer. As workflowsdeal
    in
    XML and for JDBC calls I need value objects. I have few questions:
    Is there any proffered way of communication between BPM and database?
    Does BEA/Sun/BPM Users recommend entity beans for data access thruBPM?
    Do I have to write XML to value object and vice versa logic for eachtype
    of communication?
    Please recommend a standard approach.
    Thanks,
    Parag

  • Best Practice Using Data Access Object Pattern

    I was wondering what would be the best approach with regards to implementing the Data Access Object pattern:
    Given the following database tables:
    teacher {teacher_id, teacher_name, ...}
    subject {subject_id, subject_name, ...}
    teacher_subject {teacher_id, subject_id}where teacher and subject hold details on teachers and subjects respectively and teacher_subject links teachers with the subjects that they currently teach, would I be better off:
    1) implementing three distinct DAO classes i.e. TeacherDAO, SubjectDAO, TeacherSubjectDAO, that correspond to each database table;
    2) implementing a single DAO class that controls access to all three tables, given that business operations often rely on access to all three tables e.g. getSubjectTeachers(Subject s), assignSubjectToTeacher(Subject s, Teacher t), getSubjectsTaughtBy(Teacher t)...
    Thanks
    Ian

    ...would I be better off:Depends on the system.
    If you are always going to have a teacher with subjects then all you need is one class.
    If on the other hand sometimes you are going to have subjects with teachers (given that you have a link table a many to many relationship exists) then two DAOs would exist.
    It would be unlikely for you to have a DAO for the link table unless perhaps you are anticipating a teacher having tens of thousands of subjects or one subject having tens of thousands of teachers.

  • Data Access Object for Data Warehouse?

    Hi,
    Does anyone know how the DAO pattern looks like when it is used for a data warehouse rather than a normal transactional database?
    Normally we have something like CustomerDAO or ProductDAO in the DAO pattern, but for data warehouse applications, JOINs are used and multiple tables are queried, for example, a query may contains data from the Customer, Product and Time table, what should the DAO class be named? CustomerProductTimeDAO?? Any difference in other parts of the pattern?
    Thanks in advance.
    SK

    In my opinion, there are no differences in the Data Access Object design pattern which have any thing to do with any characteristic of its implementation or the storage format of the data the pattern is designed to function with.
    The core pupose of the DAO design pattern is to encapsulate data access code and separate it from the business logic code of the application. A DAO implementation might vary from application to application. The design pattern does not specify any implementation details. A DAO implementation can be applied to group of XML data files, an Excel-based CSV file, a relational database, or an OS file system. The design is the same for all these, it is the implementation that varies.
    The core difference between an operational database and a strategic data warehouse is the purpose of why and how the data is used. It is not so much a technical difference. The relational design may vary however, there may be more tables amd ternary relationships in a data warehouse to support more fine-tuned queries; there may be less tables in a operational database to support insert/add efficiencies.
    The DAO implementation for a data warehouse would be based on the model of the databases. However the tables are set up, that is how the DAO is coded.

Maybe you are looking for

  • Failure in ORACLE POOL connection

    Hi friends, I have worked as a developer, My platform front-end is .net and back end is oracle, this product live chat, My problem is I have receive a problem from server that's is, mysql POOL connection is automatically cut from the connection, I ha

  • Can send but can't receive email through ATT POP account

    My ISP is ATT. Email is through a POP account. I've verified all the settings through the ATT support page and been on the phone with an ATT Mac (dubious) tech. I'm able to send but not receive email. I get no errors when I check mail. It just appear

  • PO Upload and Download functionality

    Hello All, We are using SRM_SERVER 5, Version 4, SP 5 and have configured Standalone scenairo. Need to know if Download and Uplaod functionality is applicable for Purchase orders with in SRM version 4. These options are available with Contracts and B

  • Unable to run UNIX command after uploading file using webutil_file_transfer

    OS: UNIX Solaries , Oracle Application Server 10g I designed a form contains 2 buttons 1- <b>Upload</b> button: to let the user upload form.fmb file to the application server using webutil_file_transfer function 2- <b>Compile</b> button to compile th

  • Image not found on publish

    Hi, I have an issue with an image that doesn't appear on one of the publish instances.  I put an image on a page, published the page (and the image) and it's working fine on one publish instance but not on the other.  In firebug we can see that we ge