Search Results

Search found 15137 results on 606 pages for 'global state'.

Page 53/606 | < Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >

  • INSERT INTO temporary table from sp_executsql

    - by gotqn
    Generally, I am bulding dynamic SQL statement that is executing using sp_executsql like this: EXEC sp_executesql @TempSQLStatement I need to insert the return result row set in something (table variable or temporary table), but I am getting the following error: Msg 208, Level 16, State 0, Line 1746 Invalid object name '#TempTable'. after executing this: INSERT INTO #TempTable EXEC sp_executesql @TempSQLStatement From what I have read, I believe the issue is caused because I am not specifying the columns of the temporary table, but I am not able to do this because the return columns count varies. I have read that I can use global temporary tables, but I have done this before and wonder is there an other way to do that.

    Read the article

  • Python How to make a cross-module function?

    - by Evan
    I want to be able to call a global function from an imported class, for example In file PetStore.py class AnimalSound(object): def __init__(self): if 'makenoise' in globals(): self.makenoise = globals()['makenoise'] else: self.makenoise = lambda: 'meow' def __str__(self): return self.makenoise() Then when I test in the Python Interpreter >>> def makenoise(): ... return 'bark' ... >>> from PetStore import AnimalSound >>> sound = AnimalSound() >>> sound.makenoise() 'meow' I get a 'meow' instead of 'bark'. I have tried using the solutions provided in python-how-to-make-a-cross-module-variable with no luck.

    Read the article

  • What are the main advantages of adding your custom functions to a javascript libraries namepsace?

    - by yaya3
    It is fairly well known in JavaScript that declaring variables within the global scope is a bad thing. So code I tend to work on contains namespaced JavaScript. There seems to be two different approaches taken to this - Adding your application specific functions to the libraries' namespace e.g. $.myCarouselfunction Creating your own namespace e.g. MyApplication.myCarouselFunction I wanted to know whether or not there is a 'better' solution or if they tend to meet somewhere close in terms of pros and cons. The reason for me personally deciding not to go with the library is for Seperation / Isolation / Lack of conflict with library code and potential plugins that are likely to share that namespace. But I am sure there is more to this. Thanks

    Read the article

  • Why do I get "could not load type" error with my custom SessionStateProvider

    - by Rising Star
    My associate has created a custom SessionStateProvider for me to use with my ASP.net application. I add the file CustomSessionStateProvider to my VS2008 Web Application Project and put the appropriate reference in the web.config and it works fine. However, my supervisor wants me to set this up as a GAC reference. At my office, we have many DLLs we've created that we use as GAC references across different projects. If I add my CustomSessionStateProvider to the Global Assembly Cache, my pages throw a could not load type CustomASP.CustomSessionStateProvider error. Simple removing the DLL from the GAC makes it work again, but I want to set this up as a GAC reference. What could be causing this problem?

    Read the article

  • PHP How to access constant defined outside class?

    - by Ashley Ward
    I have defined some constants eg: define('DB_HOSTNAME', 'localhost', true); define('DB_USERNAME', 'root', true); define('DB_PASSWORD', 'root', true); define('DB_DATABASE', 'authtest', true); now when I try to do this: class Auth{ function AuthClass() { $this->db_link = mysql_connect(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD) or die(mysql_error()); } } I get an error. Why is this and what do I need to do? See, I've tried using (for example) global DB_HOSTNAME but this fails with an error.

    Read the article

  • JavaScript's Associative Array / Object can't be read in functions

    - by Matrym
    At the very beginning of the javascript file, I have: var lbp = {}; lbp.defaults = { minLength: 40 }; I can successfully alert it afterwards, with: alert(lbp.defaults.minLength); But as soon as I put it inside a function, when I alert, I get "Undefined". What gives, and how do I avoid this? Is it absolutely necessary to pass this variable into each function, for example, by doing: function(lbp) { alert(lbp.defaults.minLength); } I would have thought that defining it first, it would attain global scope and not be required to be passed in? Thanks in advance for enlightening me :)

    Read the article

  • ViewState Vs Session ... maintaining object through page lifecycle

    - by Kyle
    Can someone please explain the difference between ViewState and Session? More specifically, I'd like to know the best way to keep an object available (continuously setting members through postbacks) throughout the lifecycle of my page. I currently use Sessions to do this, but I'm not sure if it's the best way. For example: SearchObject searchObject; protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) { searchObject = new SearchObject(); Session["searchObject"] = searchObject; } else { searchObject = (SearchObject)Session["searchObject"]; } } that allows me to use my searchObject anywhere else on my page but it's kind of cumbersome as I have to reset my session var if I change any properties etc. I'm thinking there must be a better way to do this so that .NET doesn't re-instantiate the object each time the page loads, but also puts it in the global scope of the Page class? Please advise. TIA

    Read the article

  • Problem with httpContext.RewritePath on IIS 7

    - by PNR
    I am using httpContext.RewritePath in Global.asax for som URLrewriting, and it works very well in my development environment on the Cassini server. But when I copy it to the production server, witch is a IIS 7 it isn't working. I have also tried to use Context.Server.TransferRequest but thne I get the error: "This operation requires IIS integrated pipeline mode." on both Cassini and IIS 7, and on IIS 7 the website is running in "Integreret" mode in the AppPool. I rewrite all urls on the website like /[The main menuname]/[pagename].aspx fx from /web/thesite.aspx?mainmenu=manager to /manager/thesite.aspx OR /web/theOtherSite.aspx?mainmenu=about to /about/theOtherSite.aspx And so on... Thanks very much in advance!

    Read the article

  • PHP 5.3 Namespaces should i use every PHP function with backslash?

    - by lhwparis
    Hi, im now using namespaces in PHP 5.3 now there is a fallback mechanism for functions which dont exist in the namespace. so php every time checks if the function exists in namespace and then tries to load it from global space. So what about all php internal functions? strstr for example? Should i now use every php internal function with a \ ? to avoid php first checking the namespace? is this fallback a huge performance drop? what do you think?

    Read the article

  • How can I see a variable defined in another php-file?

    - by Roman
    I use the same constant in all my php files. I do not want to assign the value of this variable in all my files. So, I wanted to create one "parameters.php" file and to the assignment there. Then in all other files I include the "parameters.php" and use variables defined in the "parameters.php". It was the idea but it does not work. I also tried to make the variable global. It also does not work. Is there a way to do what I want? Or may be there some alternative approach?

    Read the article

  • Check if IsCallback on Application_BeginRequest

    - by user136405
    I have a web application (.NET 3.5) that has this code in Global.asax: Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs) LinkLoader() PathRewriter() PathAppender() End Sub I want all those functions inside to get called except for when it's an AJAX call back. So, ideally I would have it changed to: Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs) If not Page.IsCallback then LinkLoader() PathRewriter() PathAppender() End If End Sub But there is not access to the page object here. So, basically my question is: How do I check if the request is an AJAX call back inside Application_BeginRequest? Thank you very much for any feedback.

    Read the article

  • What is the right way to modify a wordpress query in a plugin?

    - by starepod
    Basically i am playing with a plugin that allows future-dated posts on archive pages. My question is broader than this specific functionality, but everyone likes some context. I have my head around many of the plugin development concepts, but must be missing something very basic. I can successfully rewrite a query that gives me the results i want like this: function modify_where( $where ) { global $wp_query; // define $year, $cat, etc if( is_archive() ) { $where = " AND YEAR(wp_posts.post_date)='".$year."' AND wp_term_taxonomy.taxonomy = 'category' AND wp_term_taxonomy.term_id IN ('".$cat."') AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'future')"; } return $where; } add_filter('posts_where', 'catCal_where' ); However, if i attempt to create a new WP_Query('different_query_stuff') after the main loop the new query uses the same WHERE statement outlined above. The question is : What am I missing? Thanks.

    Read the article

  • JNI cached jclass global reference variables being garbage collected?

    - by bubbadoughball
    I'm working in the JNI Invocation API, calling into Java from C. I have some upfront initialization to cache 30+ Java classes into global references. The results of FindClass are passed into NewGlobalRef to acquire a global reference to the class. I'm caching these class variables to reuse them later. I have 30+ global references to classes (and 30+ global methodIDs for the class constructors). In the following sample, I've removed exception handling as well as JNI invocation for the purpose of shortening the code snippet. My working code has exception checks after every JNI call and I'm running with -Xcheck:jni. Here's the snippet: jclass aClass; jclass bClass; jmethodID aCtor; jmethodID bCtor; void getGlobalRef(const char* clazz, jclass* globalClass) { jclass local = (*jenv)->FindClass(jenv,clazz); if (local) { *globalClass = (jclass) (*jenv)->NewGlobalRef(jenv,local); (*jenv)->DeleteLocalRef(jenv,local); } } methodID getMethodID(jclass clazz, const char* method, const char* sig) { return (*jenv)->GetMethodID(jenv,clazz,method,sig); } void initializeJNI() { getGlobalRef("MyProj/Testclass1", &aclass); getGlobalRef("MyProj/Testclass2", &bclass); . . aCtor = getMethodID(aclass,"<init>","()V"); bCtor = getMethodID(bclass,"<init>","(I)V"); } The initializeJNI() function sets the global references for jclasses and method IDs for constructors as well as some jfieldID's and some initialization of C data structures. After initialization, when I call into a JNI function using some of the cached jclasses and ctor jmethodIDs, I get a bad global or local reference calling reported from the -Xcheck:jni. In gdb, I break at the last line of initializeJNI(), and print all jclasses and jmethodIDs and the ones causing problems look to have been turned into garbage or garbage-collected (i.e. 0x00 or 0x06). Is it possible for global references to be gc'ed? Any suggestions?

    Read the article

  • Anyone know the state of cocoa#?

    - by Ira Rainey
    Having just updated Mono to 2.6.3 (on OS X), I noticed in the installer that cocoa# 0.9.5 is also installed. However using MonoDevelop there are no cocoa# project templates by default, and I was wondering if anyone knew more about creating cocoa# apps. If you goto the cocoa# page on the Mono site you can see it hasn't been updated since 2008, and cocoa-sharp.com has nothing on it at all now. Has this project fallen by the wayside? If so, does anyone know of any alternatives? Winforms apps running under X11 are butt ugly and GTK# isn't much better. To have a solid bridge between Mono and Cocoa would be ideal for developing OS X desktop apps, in the same way as the MonoTouch does with Cocoa Touch for the iPhone. Any thoughts?

    Read the article

  • Load balancing and sessions

    - by vtortola
    Hi there, What is the better approach for load balancing on web servers? My services run in .NET and Mono, so they could be hosted on IIS or Apache2, and the will have to provide SSL connection. I've read two main approaches, store the state in a common server and use sticky sessions, there is any other else? I've read 3 diffent things about sticky sessions: 1)the load balancing device will know with which server did you start the connection and all the further connections from that host will be routed to the same server. 2)the load balancing devide read a cookie named: JSESSIONID 3)the load balancing devide read a cookie named: ASPSESSIONID I'm a little bit confused, what will happen exactly? As the connections will be SSL there is not a chance for the load balancing devide of read the cookies, so then what? About store the estate in a common server, what solutions do you know? I've read memcache is a good solution but is there any other else? Cheers.

    Read the article

  • ASP.NET MVC 2 JQuery POST not displaying the model state errors

    - by Oshan
    Hello, I have been using asp.net mvc for a bit (but I'm still a beginer). I want to have the ability to update two views as a result of a jquery postback. Basically I have a list and a details view. The details view is presented using a jquery popup (using jquery-UI popup). I only want to update the list if the details save is successful (i.e. there are no validation errors on the details view). However, if there are any validation errros in the details view, I want to update the details view so that the user sees the validation errors. so I thought in my controller, I return a JsonResult instead of a View. [HttpPost] public ActionResult SavePersonInfo(Person p) { if(ModelState.Valid) { return View("PersonList"); } return Json({Error = true, View = PartialView("PersonDetails", p)}); } As you can see if there are no errors I return the person list view, but if there are any validation errors, I have return the details view. The reason that I'm returning a JsonResult is I need to tell my view there is an error so that the view (jquery) knows which section to update (as in whether to update the person list 'div' or the popup dialog 'div'). So, in my view, the jquery is as follows (please assume that there is a form for entering in the person details and "SubmitPersonForm();" function is called upon clicking on the "Save" button): <script type="text/javascript> $('#btnSave').click(function (event) { onBegin(); $.ajax( { type: "POST", url: "/Person/Save", data: $('form').serialize(), success: function (result) { if(result.Error) { $('#dvDetails').html($(result).View)); } else { $('#dvPersonList').html($result); } } }); }); </script> So the problem that I have now, is that when there is a validation error, I do see the correct, 'div' being updated, but I lose the asp.net mvc validation messages. I do not see any validation errors in red, as if ASP.NET MVC is completely ignored them. However, my ModelState does have those errros, just not displayed in the details view. I do have valication summary and Html.ValidationFor(m = ...) statements put in my details view. Could someone tell me why I'm not seeing the validation errors? although I'm using a JSonResult, I do use the right property which is a valid view when I render the 'dvDetails'. Am I doing something that I'm not suppose to in asp.net mvc? Btw I'm using asp.net mvc2 RC with Visual Studio 2010 RC. Thank you.

    Read the article

  • ExtJS - Save State of treePanel.

    - by Ozaki
    TLDR I want my treepanel from EXTJS to remember its previous settings. ExtJS-3.2.1 I have seen this done before for ExtJS-2.x.x :See here on the extjs forums. But as seen as they are pretty much lifeless, with threads on there asking this question or similar with no reply for up to 6months. I thought I would bring it here. I need to be able to get my treePanel to remember previous opened folders and which boxes are checked. It is async treePanel. Panel is as follows: var layerTree = new Ext.tree.TreePanel({ border: true, region: "east", title: 'LayersTree', width: 250, split: true, collapsible: true, collapsed: true, iconCls: 'treePanelIcon', enableDD: true, autoScroll: true, //pulls in layers and their attributes// root: new Ext.tree.AsyncTreeNode({ leaf: false, loaded: false, expanded: true, text: 'Tree Root', children: treeLayers }) Am using ExtJS-3.2.1, GeoExt, OpenLayers. Anyone done this before or know how to do it? (Preferably with a plugin but any answer is appreciated)

    Read the article

  • C# System.Threading.Timer and its state object

    - by Captain NedD
    I am writing a C# program that uses System.Threading.Timer to timeout on a UDP socket ReceiveAsync call. My program polls a remote device, sending a UDP packet and expecting one in return. I use the timer in one shot mode calling Timer.Change every time I want a new timeout period. For every occurance of a timeout I'd like the timeout handler to have a different piece of information. If I change the object I pass to the Timer on creation it doesn't seem to change when the handler executes. Is the only way to do this to destroy the timer and create a new one? Thanks,

    Read the article

  • Drawing selected state on custom UITableViewCell

    - by Brian
    So I have a customer UITableViewCell whose whole display in drawn in drawRect. When it draws it creates CGLayers so that it can reuse certain pieces when something is changed. I have changed my UITableViewCellSelectionStyle to None because I don't want the default selected view to cover my drawing. So I call setNeedsDisplay in setSelected:animated: for my cell. But by the time drawRect is called, setSelected:animated: has already been called again to deselect the cell. In my table view controller in didSelectRowAtIndexPath I call deselectRowAtIndexPath as Apple advises. Any ideas? Thanks.

    Read the article

  • Control third check box based on the state of the first two using jquery

    - by Moj
    I have three check boxes and need to disable the third if either and/or of the other two are checked. I'm sure there's a easier way than what I have currently. It's turning into what I believe is a mess and I'm hoping that someone with more jquery knowledge can shine the light here. Here's my simple html form: <html> <head> <script type="text/javascript" src="jquery.js"></script> <script src="custom.js" type="text/javascript"></script> </head> <body> <input type="checkbox" class="class" id="1">First <input type="checkbox" class="class" id="2">Second <input type="checkbox" class="class" id="3">Third </body> </html> Here's the javascript I'm using with jquery v1.4.2 jQuery(document).ready(function() { // watches the events of all checkboxes $(":checkbox").click(function(){ if( // if both 1 and 2 are checked we don't want to enable Third until both are unchecked. (($('#1:checkbox').attr('checked'))&&($('#2:checkbox').attr('checked')))|| ((($('#1:checkbox').attr('checked'))&&($('#2:checkbox').attr('checked')))&&($('#3:checkbox').attr('disabled')))|| ((($('#1:checkbox').attr('checked'))||($('#2:checkbox').attr('checked')))&&($('#3:checkbox').attr('disabled'))) ){ // we don't want to do anything in the above events } else if( // handles the First check box (($('#1:checkbox').attr('checked'))||(!$('#1:checkbox').attr('checked')))|| // handles the Second check box (($('#2:checkbox').attr('checked'))||(!$('#2:checkbox').attr('checked'))) ){ // call the disableThird function disableThird(); } }); // handles enabling and disabling the Third checkbox function disableThird(){ var $checkbox = $('#3:checkbox'); $checkbox.attr('disabled', !$checkbox.attr('disabled')); }; }); For some reason checking #3 will disable it's self. I don't understand why. This works, but one of the requirements is that a non programmer should be able to edit and maintain this. Ideally it'd be great if he could just add new check boxes to the html and it would work. The class for these are define and as far as I know can't be changed. The last check box in the list of check boxes will disable if any of the ones above are selected. Like wise if the last check box is selected, it will disable all the ones above it. I haven't even begun writing and testing that portion as this is quickly becoming too complicated for a non programmer to handle. I myself am more of a PHP coder than a js, let alone jquery, coder. Any help would be greatly appreciated.

    Read the article

  • Saving State Dynamic UserControls...Help!

    - by Cognitronic
    I have page with a LinkButton on it that when clicked, I'd like to add a Usercontrol to the page. I need to be able to add/remove as many controls as the user would like. The Usercontrol consists of three dropdownlists. The first dropdownlist has it's auotpostback property set to true and hooks up the OnSelectedIndexChanged event that when fired will load the remaining two dropdownlists with the appropriate values. My problem is that no matter where I put the code in the host page, the usercontrol is not being loaded properly. I know I have to recreate the usercontrols on every postback and I've created a method that is being executed in the hosting pages OnPreInit method. I'm still getting the following error: The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases. Here is my code: Thank you!!!! bool createAgain = false; IList<FilterOptionsCollectionView> OptionControls { get { if (SessionManager.Current["controls"] != null) return (IList<FilterOptionsCollectionView>)SessionManager.Current["controls"]; else SessionManager.Current["controls"] = new List<FilterOptionsCollectionView>(); return (IList<FilterOptionsCollectionView>)SessionManager.Current["controls"]; } set { SessionManager.Current["controls"] = value; } } protected void Page_Load(object sender, EventArgs e) { Master.Page.Title = Title; LoadViewControls(Master.MainContent, Master.SideBar, Master.ToolBarContainer); } protected override void OnPreInit(EventArgs e) { base.OnPreInit(e); System.Web.UI.MasterPage m = Master; Control control = GetPostBackControl(this); if ((control != null && control.ClientID == (lbAddAndCondtion.ClientID) || createAgain)) { createAgain = true; CreateUserControl(control.ID); } } protected void AddAndConditionClicked(object o, EventArgs e) { var control = LoadControl("~/Views/FilterOptionsCollectionView.ascx"); OptionControls.Add((FilterOptionsCollectionView)control); control.ID = "options" + OptionControls.Count.ToString(); phConditions.Controls.Add(control); } public event EventHandler<Insight.Presenters.PageViewArg> OnLoadData; private Control FindControlRecursive(Control root, string id) { if (root.ID == id) { return root; } foreach (Control c in root.Controls) { Control t = FindControlRecursive(c, id); if (t != null) { return t; } } return null; } protected Control GetPostBackControl(System.Web.UI.Page page) { Control control = null; string ctrlname = Page.Request.Params["__EVENTTARGET"]; if (ctrlname != null && ctrlname != String.Empty) { control = FindControlRecursive(page, ctrlname.Split('$')[2]); } else { string ctrlStr = String.Empty; Control c = null; foreach (string ctl in Page.Request.Form) { if (ctl.EndsWith(".x") || ctl.EndsWith(".y")) { ctrlStr = ctl.Substring(0, ctl.Length - 2); c = page.FindControl(ctrlStr); } else { c = page.FindControl(ctl); } if (c is System.Web.UI.WebControls.CheckBox || c is System.Web.UI.WebControls.CheckBoxList) { control = c; break; } } } return control; } protected void CreateUserControl(string controlID) { try { if (createAgain && phConditions != null) { if (OptionControls.Count > 0) { phConditions.Controls.Clear(); foreach (var c in OptionControls) { phConditions.Controls.Add(c); } } } } catch (Exception ex) { throw ex; } } Here is the usercontrol's code: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FilterOptionsCollectionView.ascx.cs" Inherits="Insight.Website.Views.FilterOptionsCollectionView" %> namespace Insight.Website.Views { [ViewStateModeById] public partial class FilterOptionsCollectionView : System.Web.UI.UserControl { protected void Page_Load(object sender, EventArgs e) { } protected override void OnInit(EventArgs e) { LoadColumns(); ddlColumns.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(ColumnsSelectedIndexChanged); base.OnInit(e); } protected void ColumnsSelectedIndexChanged(object o, EventArgs e) { LoadCriteria(); } public void LoadColumns() { ddlColumns.DataSource = User.GetItemSearchProperties(); ddlColumns.DataTextField = "SearchColumn"; ddlColumns.DataValueField = "CriteriaSearchControlType"; ddlColumns.DataBind(); LoadCriteria(); } private void LoadCriteria() { var controlType = User.GetItemSearchProperties()[ddlColumns.SelectedIndex].CriteriaSearchControlType; var ops = User.GetItemSearchProperties()[ddlColumns.SelectedIndex].ValidOperators; ddlOperators.DataSource = ops; ddlOperators.DataTextField = "key"; ddlOperators.DataValueField = "value"; ddlOperators.DataBind(); switch (controlType) { case ResourceStrings.ViewFilter_ControlTypes_DDL: criteriaDDL.Visible = true; criteriaText.Visible = false; var crit = User.GetItemSearchProperties()[ddlColumns.SelectedIndex].SearchCriteria; ddlCriteria.DataSource = crit; ddlCriteria.DataBind(); break; case ResourceStrings.ViewFilter_ControlTypes_Text: criteriaDDL.Visible = false; criteriaText.Visible = true; break; } } public event EventHandler OnColumnChanged; public ISearchCriterion FilterOptionsValues { get; set; } } }

    Read the article

  • jquery navbar active state stays through refresh

    - by bob
    Hello, I am building a web application and because it has a layout. I don't want to have to create a seperate navigation bar for each page. I am wondering if I can assign an active class to a link that gets clicked on my navbar which will keep the active class even after a page refresh. html <div id="navbar"> <ul id = "main_nav"> <li><%= link_to '', root_path, :class => "home" %></li> <li><%= link_to '', junklists_path, :class => "buy" %></li> <li><%= link_to '', post_junk_path, :class => "sell" %></li> <li><%= link_to '', contact_path, :class => "contact" %></li> </ul> </div> jquery $("#main_nav li a").click(function(){ $("#main_nav li a.active").removeClass('active'); $(this).stop().addClass('active'); }) What options do I have? Thanks in advance!

    Read the article

  • Is it actually possible to programmatically manage the state of an FTP server in IIS7?

    - by nbolton
    I'm able to manage FTP sites via the IIS manager, however, all attempts so far to manage the state of FTP sites using other means have failed, including: Using the IIS7 API (Microsoft.Web.Administration) Using WMI (with IIS6 compatibility enabled) Using the AppCmd tool in System32\inetsrv Related questions: Why am I unable to get Site.State for an FTP site, when using Microsoft.Web.Administration? Are there any workarounds I haven't tried? My objective is to manage (start/stop/query the state of) the FTP sites with C# code (as you can see from the 3 above attempted workarounds). When querying the FTP server state using WMI, it returns code 4, which means "Stopped", even though the site is definitely shown as running in IIS manager. AppCmd is useless, as it returns "Unknown" for FTP sites: c:\Windows\System32\inetsrv>appcmd list site SITE "Default Web Site" (id:1,bindings:http/*:80:,state:Stopped) SITE "Default FTP Site" (id:2,bindings:ftp/*:21:,state:Unknown)

    Read the article

  • Linking session state between servlets and EJBs?

    - by wilth
    Hello, I have servlets (in a web module) that access stateless EJB beans (in an EJB module). The EJB module is built using SEAM. Users can have different roles and the EJB services check this using Seam's Identity. I also use a customized Authenticator (although this might not be relevant here). I noticed problems with this approach and I'm suspecting that the session context in the servlets is not "linked" with the session context in the EJB beans. What I think happens is something like: User Joe access servlet A and is assigned Session W1. Servlet A calls a login function on an EJB, using the EJB session E1. Later, user Mary accesses servlet A and is assigned Session W2. When calling the EJBs, however, the EJB session E1 is used and therefore Mary is authenticated as Joe. What also happens is that when Joe is calling the servlet twice in rapid succession, the same session W1 is used, but two different sessions E1 and E2 in the business layer, causing errors. I might be wrong in my suspicion, but maybe I'm actually expecting these "sessions" to be linked together while they in fact are not. If this is true, is there any way of achieving this? I could - of course - use stateful beans and save the authentication information in the beans, but this would break the "Identity" concept of Seam (and in general, it would be preferable to be able to use the Session context in my EJB beans). Any help and pointers are very welcome - thanks! Technology: EJB3, Seam 2.1.2. The servlets are actually the server-side of a GWT app, although I don't think this matters much. I'm using JBoss 5.

    Read the article

  • WorkflowMarkupSerializer doesn't keep positions in a state machine workflow

    - by Khadaji
    I am using WorkflowMarkupSerializer to save a statemachine workflow - it saves the states OK, but does not keep their positions. The code to write the workflow is here: using (XmlWriter xmlWriter = XmlWriter.Create(fileName)) { WorkflowMarkupSerializer markupSerializer = new WorkflowMarkupSerializer(); markupSerializer.Serialize(xmlWriter, workflow); } The code to read the workflow is: DesignerSerializationManager dsm = new DesignerSerializationManager(); using (dsm.CreateSession()) { using (XmlReader xmlReader = XmlReader.Create(fileName)) { //deserialize the workflow from the XmlReader WorkflowMarkupSerializer markupSerializer = new WorkflowMarkupSerializer(); workflow = markupSerializer.Deserialize( dsm, xmlReader) as Activity; if (dsm.Errors.Count > 0) { WorkflowMarkupSerializationException error = dsm.Errors[0] as WorkflowMarkupSerializationException; throw error; } } }

    Read the article

< Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >